Projecte

General

Perfil

Repository » Historial » Versió 35

Simó Albert i Beltran, 07-03-2013 15:30
Reserve current workflow for the future.

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