Projecte

General

Perfil

Repository » Historial » Versió 41

Simó Albert i Beltran, 09-06-2013 17:41

1 40 Simó Albert i Beltran
h1. Repository workflow
2 35 Simó Albert i Beltran
3 1 Pau Escrich
h2. Structure
4
5
The qMp git repository is split in three branches:
6
7
# Master
8
# Testing
9 23 Simó Albert i Beltran
# Other: Features/Bugfixes
10 1 Pau Escrich
11
h3. Master
12
13
This is the main branch and all changes committed here must be tested in Testing branch before.
14
15 6 Simó Albert i Beltran
However the small bugfixes can be directly applied here. These changes must be merged in the testing branch.
16 1 Pau Escrich
17 10 Simó Albert i Beltran
<pre>
18
o---o---o---o---o master
19
                 \  
20
--o---o---o---o---o testing 
21
</pre>
22
23 22 Simó Albert i Beltran
*Example:*
24 30 Anònim
<pre><code class="shell">
25 32 Simó Albert i Beltran
git checkout origin/testing
26
git merge origin/master
27 29 Simó Albert i Beltran
</code></pre>
28 22 Simó Albert i Beltran
29
30 1 Pau Escrich
h3. Testing
31
32 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.
33 1 Pau Escrich
34 41 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. Each developer can specify the commit that he thinks is a candidate to merge in master with a signed tag.
35 11 Simó Albert i Beltran
36
<pre>
37
o---o---o---o---o master
38
     \         /  
39
--o---o---o---o testing 
40
</pre>
41
42 16 Pau Escrich
*Example:*
43 11 Simó Albert i Beltran
44 16 Pau Escrich
Import master bugfixes to testing
45 30 Anònim
<pre><code class="shell">
46 32 Simó Albert i Beltran
git checkout origin/testing
47
git merge origin/master
48 29 Simó Albert i Beltran
</code></pre>
49 16 Pau Escrich
50
Merge testing changes in master
51 30 Anònim
<pre><code class="shell">
52 1 Pau Escrich
git checkout origin/master
53 41 Simó Albert i Beltran
git merge origin/testing
54
</code></pre>
55
56
Add a signed tag
57
<pre><code class="shell">
58
git tag -s master_candidate_mynick -m "Proposal to update master branch by MyName."
59
git push origin master_candidate_mynick
60 32 Simó Albert i Beltran
git merge origin/testing
61 29 Simó Albert i Beltran
</code></pre>
62 16 Pau Escrich
63 12 Simó Albert i Beltran
h3. Other: Features/Bugfixes
64 1 Pau Escrich
65 8 Simó Albert i Beltran
The rest of the branches are temporal branches.
66
67 26 Simó Albert i Beltran
h4. Features
68
69 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.
70 1 Pau Escrich
71 9 Simó Albert i Beltran
<pre>
72
o---o---o---o---o master
73 14 Simó Albert i Beltran
     \
74 9 Simó Albert i Beltran
      o---o---o issue#23-new-feature
75 14 Simó Albert i Beltran
               \
76 9 Simó Albert i Beltran
o---o---o---o---o testing 
77
</pre>
78
79 16 Pau Escrich
*Example:*
80 9 Simó Albert i Beltran
81 30 Anònim
<pre><code class="shell">
82 24 Simó Albert i Beltran
git checkout -b issue#23-new-feature origin/master
83
editor dir/file
84 25 Simó Albert i Beltran
git add dir/file
85 24 Simó Albert i Beltran
git commit
86
#test issue#23-new-feature branch
87 32 Simó Albert i Beltran
git checkout origin/testing
88 24 Simó Albert i Beltran
git merge issue#23-new-feature
89 29 Simó Albert i Beltran
</code></pre>
90 24 Simó Albert i Beltran
91 27 Simó Albert i Beltran
h4. Bugfixes
92 24 Simó Albert i Beltran
93 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.
94 7 Simó Albert i Beltran
95
<pre>
96
o---o---o---o---o master
97 1 Pau Escrich
     \         /
98 9 Simó Albert i Beltran
      o---o---o issue#23-bugfix
99 7 Simó Albert i Beltran
               \
100
o---o---o---o---o testing 
101
</pre>
102 16 Pau Escrich
103
*Example:*
104 1 Pau Escrich
105 30 Anònim
<pre><code class="shell">
106 28 Simó Albert i Beltran
git checkout -b issue#23-bugfix origin/master
107
editor dir/file
108
git add dir/file
109
git commit
110
#test issue#23-bugfix branch
111
git checkout origin/testing
112
git merge issue#23-bugfix
113
git checkout origin/master
114
git merge issue#23-bugfix
115 29 Simó Albert i Beltran
</code></pre>
116 28 Simó Albert i Beltran
117
118 1 Pau Escrich
h2. How to use it
119
120 2 Pau Escrich
121
h2. Good practices