Project

General

Profile

Repository » History » Version 38

Simó Albert i Beltran, 03/07/2013 05:21 PM
New feature workflow.

1 1 Pau Escrich
h1. Repository
2 1 Pau Escrich
3 35 Simó Albert i Beltran
At the moment we work with a main branch, the master branch.
4 35 Simó Albert i Beltran
5 36 Simó Albert i Beltran
If you want solve a bug you could start a new branch based in a commit that introduces a bug or based in a head of master branch.
6 38 Simó Albert i Beltran
7 36 Simó Albert i Beltran
<pre>
8 36 Simó Albert i Beltran
     ----o issue#23
9 36 Simó Albert i Beltran
    /     \
10 36 Simó Albert i Beltran
o--o--o----o master
11 36 Simó Albert i Beltran
   ^
12 36 Simó Albert i Beltran
    commit with an error, it causes error described in issue 23.
13 38 Simó Albert i Beltran
</pre>
14 38 Simó Albert i Beltran
15 38 Simó Albert i Beltran
<pre>
16 38 Simó Albert i Beltran
     o--o issue#23
17 38 Simó Albert i Beltran
    /
18 38 Simó Albert i Beltran
o--o master
19 38 Simó Albert i Beltran
   ^
20 38 Simó Albert i Beltran
    this commit is not related with the issue 23, but right now is the head of master branch.
21 38 Simó Albert i Beltran
</pre>
22 38 Simó Albert i Beltran
23 38 Simó Albert i Beltran
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.
24 38 Simó Albert i Beltran
25 38 Simó Albert i Beltran
<pre>
26 38 Simó Albert i Beltran
     o--o--o issue#23
27 38 Simó Albert i Beltran
    /
28 38 Simó Albert i Beltran
o--o master
29 38 Simó Albert i Beltran
</pre>
30 38 Simó Albert i Beltran
31 38 Simó Albert i Beltran
<pre>
32 38 Simó Albert i Beltran
             o--o issue#23
33 38 Simó Albert i Beltran
            /
34 38 Simó Albert i Beltran
     o--o--o--o--o issue#21
35 38 Simó Albert i Beltran
    /      ^this commit has last changes needed for new feature that is described in issue 23.
36 38 Simó Albert i Beltran
o--o master
37 37 Simó Albert i Beltran
</pre>
38 35 Simó Albert i Beltran
39 35 Simó Albert i Beltran
h1. Possible future workflow:
40 35 Simó Albert i Beltran
41 1 Pau Escrich
h2. Structure
42 1 Pau Escrich
43 1 Pau Escrich
The qMp git repository is split in three branches:
44 1 Pau Escrich
45 1 Pau Escrich
# Master
46 1 Pau Escrich
# Testing
47 23 Simó Albert i Beltran
# Other: Features/Bugfixes
48 1 Pau Escrich
49 1 Pau Escrich
h3. Master
50 1 Pau Escrich
51 1 Pau Escrich
This is the main branch and all changes committed here must be tested in Testing branch before.
52 1 Pau Escrich
53 6 Simó Albert i Beltran
However the small bugfixes can be directly applied here. These changes must be merged in the testing branch.
54 1 Pau Escrich
55 10 Simó Albert i Beltran
<pre>
56 10 Simó Albert i Beltran
o---o---o---o---o master
57 10 Simó Albert i Beltran
                 \  
58 10 Simó Albert i Beltran
--o---o---o---o---o testing 
59 10 Simó Albert i Beltran
</pre>
60 10 Simó Albert i Beltran
61 22 Simó Albert i Beltran
*Example:*
62 30 Anonymous
<pre><code class="shell">
63 32 Simó Albert i Beltran
git checkout origin/testing
64 32 Simó Albert i Beltran
git merge origin/master
65 29 Simó Albert i Beltran
</code></pre>
66 22 Simó Albert i Beltran
67 22 Simó Albert i Beltran
68 1 Pau Escrich
h3. Testing
69 1 Pau Escrich
70 8 Simó Albert i Beltran
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.
71 1 Pau Escrich
72 15 Simó Albert i Beltran
When the testing branch are deeply tested by more than one developer, than it can be merged on the master branch.
73 11 Simó Albert i Beltran
74 11 Simó Albert i Beltran
<pre>
75 11 Simó Albert i Beltran
o---o---o---o---o master
76 11 Simó Albert i Beltran
     \         /  
77 11 Simó Albert i Beltran
--o---o---o---o testing 
78 11 Simó Albert i Beltran
</pre>
79 11 Simó Albert i Beltran
80 16 Pau Escrich
*Example:*
81 11 Simó Albert i Beltran
82 16 Pau Escrich
Import master bugfixes to testing
83 30 Anonymous
<pre><code class="shell">
84 32 Simó Albert i Beltran
git checkout origin/testing
85 32 Simó Albert i Beltran
git merge origin/master
86 29 Simó Albert i Beltran
</code></pre>
87 16 Pau Escrich
88 16 Pau Escrich
Merge testing changes in master
89 30 Anonymous
<pre><code class="shell">
90 32 Simó Albert i Beltran
git checkout origin/master
91 32 Simó Albert i Beltran
git merge origin/testing
92 29 Simó Albert i Beltran
</code></pre>
93 16 Pau Escrich
94 12 Simó Albert i Beltran
h3. Other: Features/Bugfixes
95 1 Pau Escrich
96 8 Simó Albert i Beltran
The rest of the branches are temporal branches.
97 8 Simó Albert i Beltran
98 26 Simó Albert i Beltran
h4. Features
99 26 Simó Albert i Beltran
100 34 Simó Albert i Beltran
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.
101 1 Pau Escrich
102 9 Simó Albert i Beltran
<pre>
103 9 Simó Albert i Beltran
o---o---o---o---o master
104 14 Simó Albert i Beltran
     \
105 9 Simó Albert i Beltran
      o---o---o issue#23-new-feature
106 14 Simó Albert i Beltran
               \
107 9 Simó Albert i Beltran
o---o---o---o---o testing 
108 9 Simó Albert i Beltran
</pre>
109 9 Simó Albert i Beltran
110 16 Pau Escrich
*Example:*
111 9 Simó Albert i Beltran
112 30 Anonymous
<pre><code class="shell">
113 24 Simó Albert i Beltran
git checkout -b issue#23-new-feature origin/master
114 24 Simó Albert i Beltran
editor dir/file
115 25 Simó Albert i Beltran
git add dir/file
116 24 Simó Albert i Beltran
git commit
117 24 Simó Albert i Beltran
#test issue#23-new-feature branch
118 32 Simó Albert i Beltran
git checkout origin/testing
119 24 Simó Albert i Beltran
git merge issue#23-new-feature
120 29 Simó Albert i Beltran
</code></pre>
121 24 Simó Albert i Beltran
122 27 Simó Albert i Beltran
h4. Bugfixes
123 24 Simó Albert i Beltran
124 33 Simó Albert i Beltran
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.
125 7 Simó Albert i Beltran
126 7 Simó Albert i Beltran
<pre>
127 7 Simó Albert i Beltran
o---o---o---o---o master
128 1 Pau Escrich
     \         /
129 9 Simó Albert i Beltran
      o---o---o issue#23-bugfix
130 7 Simó Albert i Beltran
               \
131 7 Simó Albert i Beltran
o---o---o---o---o testing 
132 7 Simó Albert i Beltran
</pre>
133 16 Pau Escrich
134 16 Pau Escrich
*Example:*
135 1 Pau Escrich
136 30 Anonymous
<pre><code class="shell">
137 28 Simó Albert i Beltran
git checkout -b issue#23-bugfix origin/master
138 28 Simó Albert i Beltran
editor dir/file
139 28 Simó Albert i Beltran
git add dir/file
140 28 Simó Albert i Beltran
git commit
141 28 Simó Albert i Beltran
#test issue#23-bugfix branch
142 28 Simó Albert i Beltran
git checkout origin/testing
143 28 Simó Albert i Beltran
git merge issue#23-bugfix
144 28 Simó Albert i Beltran
git checkout origin/master
145 28 Simó Albert i Beltran
git merge issue#23-bugfix
146 29 Simó Albert i Beltran
</code></pre>
147 28 Simó Albert i Beltran
148 28 Simó Albert i Beltran
149 1 Pau Escrich
h2. How to use it
150 1 Pau Escrich
151 2 Pau Escrich
152 2 Pau Escrich
h2. Good practices