OLD | NEW |
1 # Introduction | 1 # Introduction |
2 | 2 |
3 Kai Wang (kaiwang@) and I (Jói Sigurðsson, joi@) experimented with something we
called “shift-based development” in the first half of Q1 2013 as a way to work c
losely together on a componentization that was hard to do in parallel. | 3 Kai Wang (kaiwang@) and I (Jói Sigurðsson, joi@) experimented with something we
called “shift-based development” in the first half of Q1 2013 as a way to work c
losely together on a componentization that was hard to do in parallel. |
4 | 4 |
5 I work from Iceland, which is 7 or 8 hours ahead of Kai’s location (Mountain Vie
w, California), depending on the time of year (daylight savings time is not obse
rved in Iceland). Kai and I were working on componentizing the Prefs subsystem o
f Chromium, and it was obvious early on that if we tried to develop in parallel,
we would step on each others’ toes very regularly and be forced to do often dif
ficult merges (due to e.g. moving files, renaming things, and so on). The idea c
ame up, since my normal work day ends right around the time Kai’s starts, why no
t do the development in serial instead. Although I often work an extra hour or t
wo later in the evening, that’s normally for responding to code review requests
and email and not so much for coding, so this way we’d be completely free of get
ting in each others’ way. | 5 I work from Iceland, which is 7 or 8 hours ahead of Kai’s location (Mountain Vie
w, California), depending on the time of year (daylight savings time is not obse
rved in Iceland). Kai and I were working on componentizing the Prefs subsystem o
f Chromium, and it was obvious early on that if we tried to develop in parallel,
we would step on each others’ toes very regularly and be forced to do often dif
ficult merges (due to e.g. moving files, renaming things, and so on). The idea c
ame up, since my normal work day ends right around the time Kai’s starts, why no
t do the development in serial instead. Although I often work an extra hour or t
wo later in the evening, that’s normally for responding to code review requests
and email and not so much for coding, so this way we’d be completely free of get
ting in each others’ way. |
6 | 6 |
7 The way we implemented this was we set up a bare git repository, and at the end
of the day, we would push whatever we were working on to this repository, and le
t the other know the status of things. This could be a single working branch, or
(more often) a pipeline of branches, plus a branch representing the SVN revisio
n we were based off of. To make this work, we were both using the unmanaged git
workflow. | 7 The way we implemented this was we set up a bare git repository, and at the end
of the day, we would push whatever we were working on to this repository, and le
t the other know the status of things. This could be a single working branch, or
(more often) a pipeline of branches, plus a branch representing the SVN revisio
n we were based off of. To make this work, we were both using the unmanaged git
workflow. |
8 | 8 |
9 The idea was, the next “shift” would pull down the pipeline of branches and cont
inue where the last left off, doing development on the last change in the pipeli
ne if it was incomplete, landing whatever changes could be landed, or starting a
new change in the pipeline if all of them were ready for review or ready to lan
d. | 9 The idea was, the next “shift” would pull down the pipeline of branches and cont
inue where the last left off, doing development on the last change in the pipeli
ne if it was incomplete, landing whatever changes could be landed, or starting a
new change in the pipeline if all of them were ready for review or ready to lan
d. |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 for each branch. | 99 for each branch. |
100 | 100 |
101 d) At the start of our shift, we did `git fetch shiftrepo` and then | 101 d) At the start of our shift, we did `git fetch shiftrepo` and then |
102 for each branch we were collaborating on we did `git checkout branchname && git
merge shiftrepo/branchname`. Note that the first command checks | 102 for each branch we were collaborating on we did `git checkout branchname && git
merge shiftrepo/branchname`. Note that the first command checks |
103 out the local branch, and the second merges the shiftrepo/ branch into | 103 out the local branch, and the second merges the shiftrepo/ branch into |
104 it. This does not make the shiftrepo/ branch a parent of the local | 104 it. This does not make the shiftrepo/ branch a parent of the local |
105 branch. | 105 branch. |
106 | 106 |
107 e) Also at the start of each shift, we updated the local upstream | 107 e) Also at the start of each shift, we updated the local upstream |
108 branches for each branch to match the upstream relationships that the | 108 branches for each branch to match the upstream relationships that the |
109 person ending their shift had on his end. One case is if the oldest | 109 person ending their shift had on their end. One case is if the oldest |
110 branch in the pipeline has been merged to a new LKGR, then we did this: | 110 branch in the pipeline has been merged to a new LKGR, then we did this: |
111 | 111 |
112 ``` | 112 ``` |
113 git branch --set-upstream oldestBranchName `git log -1 --grep=src@ oldestBranchN
ame | head -1 | cut -d " " -f2` | 113 git branch --set-upstream oldestBranchName `git log -1 --grep=src@ oldestBranchN
ame | head -1 | cut -d " " -f2` |
114 ``` | 114 ``` |
115 | 115 |
116 and the other case is if new branches were created during the last shift, e.g. p
4-foo was added, then for each we need to do like this: | 116 and the other case is if new branches were created during the last shift, e.g. p
4-foo was added, then for each we need to do like this: |
117 | 117 |
118 ``` | 118 ``` |
119 git branch --set-upstream p4-foo p3-bar | 119 git branch --set-upstream p4-foo p3-bar |
(...skipping 21 matching lines...) Expand all Loading... |
141 next branches to work on. | 141 next branches to work on. |
142 | 142 |
143 ## Random Commands | 143 ## Random Commands |
144 | 144 |
145 To push a local branch to shiftrepo: `git push shiftrepo localbranchname` | 145 To push a local branch to shiftrepo: `git push shiftrepo localbranchname` |
146 | 146 |
147 To push all "matching" branches (i.e. push the latest copy of | 147 To push all "matching" branches (i.e. push the latest copy of |
148 any local branch that has previously been pushed to shiftrepo): `git push shiftr
epo` | 148 any local branch that has previously been pushed to shiftrepo): `git push shiftr
epo` |
149 | 149 |
150 To delete a branch from shiftrepo, it's weird: `git push shiftrepo :branchname` | 150 To delete a branch from shiftrepo, it's weird: `git push shiftrepo :branchname` |
OLD | NEW |