OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 BLANK_DEMO=1 | 2 BLANK_DEMO=1 |
3 . demo_repo.sh | 3 . demo_repo.sh |
4 | 4 |
5 trunc() { | 5 trunc() { |
6 echo ... truncated output ... | 6 echo ... truncated output ... |
7 } | 7 } |
8 | 8 |
9 trunc_command() { | 9 trunc_command() { |
10 pcommand "$@" | 10 pcommand "$@" |
11 trunc | 11 trunc |
12 } | 12 } |
13 | 13 |
14 WS=build/whitespace_file.txt | 14 WS=build/whitespace_file.txt |
15 add_ws() { | 15 add_ws() { |
16 praw cat '>>' $WS '<<EOF' | 16 praw cat '>>' $WS '<<EOF' |
17 echo -e "$1" | 17 echo -e "$1" |
18 echo EOF | 18 echo EOF |
19 echo -e "$1" >> $WS | 19 echo -e "$1" >> $WS |
20 } | 20 } |
21 | 21 |
22 ed_ws() { | 22 ed_ws() { |
23 echo -ne "\x1B[37;1m$ echo -e " | 23 echo -ne "\x1B[37;1m$ echo -e " |
24 echo -n "'$1'" | 24 echo -n "'$1'" |
25 echo -e " | ed $WS\x1B[m" | 25 echo -e " | ed $WS\x1B[m" |
26 echo -e "$1" | ed $WS | 26 echo -e "$1" | ed $WS 2>&1 |
27 } | 27 } |
28 | 28 |
29 # needs an extra echo afterwards | 29 # needs an extra echo afterwards |
30 map() { | 30 map() { |
31 run git map | 31 run git map |
32 echo | 32 echo |
33 } | 33 } |
34 | 34 |
35 ED1='/Banana\ns/Banana/Kuun\nwq' | 35 ED1='/Banana\ns/Banana/Kuun\nwq' |
36 | 36 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 comment "Since we know that chapter 3 depends on chapter 2, we'll track the" | 110 comment "Since we know that chapter 3 depends on chapter 2, we'll track the" |
111 comment "current chapter2 branch." | 111 comment "current chapter2 branch." |
112 run git new-branch --upstream_current chap3 | 112 run git new-branch --upstream_current chap3 |
113 add_ws "$ADD3" | 113 add_ws "$ADD3" |
114 run git commit -am 'beginning of chapter 3' | 114 run git commit -am 'beginning of chapter 3' |
115 map | 115 map |
116 | 116 |
117 comment "We haven't updated the code in a while, so let's do that now." | 117 comment "We haven't updated the code in a while, so let's do that now." |
118 pcommand git rebase-update | 118 pcommand git rebase-update |
119 echo Fetching origin | 119 echo Fetching origin |
120 git fetch origin 2>&1 | grep -v 'stage' | 120 git fetch origin 2>&1 | grep -v 'stage' | sed 's+From.*+From https://upstream+' |
121 silent git update-ref refs/remotes/origin/master stage_2 | 121 silent git update-ref refs/remotes/origin/master stage_2 |
122 silent git tag -d $(git tag -l 'stage_*') | 122 silent git tag -d $(git tag -l 'stage_*') |
123 git rebase-update --no_fetch | 123 git rebase-update --no_fetch |
124 | 124 |
125 comment "Well look at that. The CQ landed our typo and chapter2 branches " | 125 comment "Well look at that. The CQ landed our typo and chapter2 branches " |
126 comment "already and git rebase-update cleaned them up for us." | 126 comment "already and git rebase-update cleaned them up for us." |
127 trunc_command gclient sync | 127 trunc_command gclient sync |
128 map | 128 map |
129 | 129 |
130 comment "Someone on IRC mentions that they actually landed a chapter 3 already!" | 130 comment "Someone on IRC mentions that they actually landed a chapter 3 already!" |
131 comment "We should pull their changes before continuing. Brace for" | 131 comment "We should pull their changes before continuing. Brace for" |
132 comment "a code conflict!" | 132 comment "a code conflict!" |
133 pcommand git rebase-update | 133 pcommand git rebase-update |
134 echo Fetching origin | 134 echo Fetching origin |
135 git fetch origin 2>&1 | grep -v 'stage' | 135 git fetch origin 2>&1 | grep -v 'stage' | sed 's+From.*+From https://upstream+' |
136 silent git tag -d $(git tag -l 'stage_*') | 136 silent git tag -d $(git tag -l 'stage_*') |
137 echo Rebasing: chap2 | 137 echo Rebasing: chap2 |
138 silent git rebase-update | 138 silent git rebase-update |
139 echo ... lots of output, it\'s a conflict alright :\(... | 139 echo ... lots of output, it\'s a conflict alright :\(... |
140 run git diff | 140 run git diff |
141 | 141 |
142 comment "Oh, well, that's not too bad. In fact... that's a terrible chapter 3!" | 142 comment "Oh, well, that's not too bad. In fact... that's a terrible chapter 3!" |
143 praw \$EDITOR "$WS" | 143 praw \$EDITOR "$WS" |
144 echo "... /me deletes bad chapter 3 ..." | 144 echo "... /me deletes bad chapter 3 ..." |
145 silent git checkout --theirs -- "$WS" | 145 silent git checkout --theirs -- "$WS" |
146 run git add "$WS" | 146 run git add "$WS" |
147 run git diff --cached | 147 run git diff --cached |
148 | 148 |
149 comment "Much better" | 149 comment "Much better" |
150 run git rebase --continue | 150 run git rebase --continue |
151 run git rebase-update | 151 run git rebase-update |
152 silent git tag -d $(git tag -l 'stage_*') | 152 silent git tag -d $(git tag -l 'stage_*') |
153 trunc_command gclient sync | 153 trunc_command gclient sync |
154 map | 154 map |
155 trunc_command git cl upload | 155 trunc_command git cl upload |
OLD | NEW |