Projecte

General

Perfil

Repository » Historial » Revisió 39

Revisió 38 (Simó Albert i Beltran, 07-03-2013 17:21) → Revisió 39/43 (Simó Albert i Beltran, 07-03-2013 17:24)

h1. Repository 

 At the moment we work with a main branch, the master branch. 

 If you want solve a bug, then bug you could start a new branch based in a commit that introduces a bug or based in a head of master branch. 

 <pre> 
      ----o issue#23 
     /       \ 
 o--o--o----o master 
    ^ 
     commit with an error, it causes error described in issue 23. 
 </pre> 

 <pre> 
      o--o issue#23 
     / 
 o--o master 
    ^ 
     this commit is not related with the issue 23, but right now is the head of master branch. 
 </pre> 

 If you want implement a new feature is preferable you start a new branch based in a head of master branch, optionally you can start a new branch based in a commit that contains features implemented by other branch. 

 <pre> 
      o--o--o issue#23 
     / 
 o--o master 
 </pre> 

 <pre> 
              o--o issue#23 
             / 
      o--o--o--o--o issue#21 
     /        ^this commit has last changes needed for new feature that is described in issue 23. 
 o--o master 
 </pre> 

 h1. Possible future workflow: 

 h2. Structure 

 The qMp git repository is split in three branches: 

 # Master 
 # Testing 
 # Other: Features/Bugfixes 

 h3. Master 

 This is the main branch and all changes committed here must be tested in Testing branch before. 

 However the small bugfixes can be directly applied here. These changes must be merged in the testing branch. 

 <pre> 
 o---o---o---o---o master 
                  \   
 --o---o---o---o---o testing  
 </pre> 

 *Example:* 
 <pre><code class="shell"> 
 git checkout origin/testing 
 git merge origin/master 
 </code></pre> 


 h3. Testing 

 This is the branch for test new features and changes. The features must be already working features tested before in a specific branch by at least the developer. A feature can be committed here only when it is finished, but not in a middle state. 

 When the testing branch are deeply tested by more than one developer, than it can be merged on the master branch. 

 <pre> 
 o---o---o---o---o master 
      \           /   
 --o---o---o---o testing  
 </pre> 

 *Example:* 

 Import master bugfixes to testing 
 <pre><code class="shell"> 
 git checkout origin/testing 
 git merge origin/master 
 </code></pre> 

 Merge testing changes in master 
 <pre><code class="shell"> 
 git checkout origin/master 
 git merge origin/testing 
 </code></pre> 

 h3. Other: Features/Bugfixes 

 The rest of the branches are temporal branches. 

 h4. Features 

 If it is about a new feature the name of the branch must be the name of the feature (of some name which identifies it). These branches are considered non-functional, so a non-finished feature can be committed here. This branch should preferably be based on a commit of master branch. Once the feature is finish and tested by at least the developer, it should be merged to testing and other branches. 

 <pre> 
 o---o---o---o---o master 
      \ 
       o---o---o issue#23-new-feature 
                \ 
 o---o---o---o---o testing  
 </pre> 

 *Example:* 

 <pre><code class="shell"> 
 git checkout -b issue#23-new-feature origin/master 
 editor dir/file 
 git add dir/file 
 git commit 
 #test issue#23-new-feature branch 
 git checkout origin/testing 
 git merge issue#23-new-feature 
 </code></pre> 

 h4. Bugfixes 

 A bugfix must be implemented in a new branch. This branch must be based on a commit of the master branch. This branch should not be based on a commit of the testing branch because it may contain new features and these maybe cannot be imported in the master branch. This new branch can be merged in testing and other branches. 

 <pre> 
 o---o---o---o---o master 
      \           / 
       o---o---o issue#23-bugfix 
                \ 
 o---o---o---o---o testing  
 </pre> 

 *Example:* 

 <pre><code class="shell"> 
 git checkout -b issue#23-bugfix origin/master 
 editor dir/file 
 git add dir/file 
 git commit 
 #test issue#23-bugfix branch 
 git checkout origin/testing 
 git merge issue#23-bugfix 
 git checkout origin/master 
 git merge issue#23-bugfix 
 </code></pre> 


 h2. How to use it 


 h2. Good practices