OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 BLANK_DEMO=1 | |
3 . demo_repo.sh | |
4 | |
5 trunc() { | |
6 echo ... truncated output ... | |
7 } | |
8 | |
9 trunc_command() { | |
10 pcommand "$@" | |
11 trunc | |
12 } | |
13 | |
14 WS=build/whitespace_file.txt | |
15 add_ws() { | |
16 praw cat '>>' $WS '<<EOF' | |
17 echo -e "$1" | |
18 echo EOF | |
19 echo -e "$1" >> $WS | |
20 } | |
21 | |
22 ed_ws() { | |
23 echo -ne "\x1B[37;1m$ echo -e " | |
24 echo -n "'$1'" | |
25 echo -e " | ed $WS\x1B[m" | |
26 echo -e "$1" | ed $WS 2>&1 | |
27 } | |
28 | |
29 # needs an extra echo afterwards | |
30 map() { | |
31 run git map | |
32 echo | |
33 } | |
34 | |
35 ED1='/Banana\ns/Banana/Kuun\nwq' | |
36 | |
37 ADD1=" | |
38 \"You recall what happened on Mulholland drive?\" The ceiling fan rotated slowly | |
39 overhead, barely disturbing the thick cigarette smoke. No doubt was left about | |
40 when the fan was last cleaned." | |
41 | |
42 ED2='/Kuun\ns/Kuun/Kun\nwq' | |
43 | |
44 ADD2=" | |
45 There was an poignant pause." | |
46 | |
47 ADD3=" | |
48 CHAPTER 3: | |
49 Mr. Usagi felt that something wasn't right. Shortly after the Domo-Kun left he | |
50 began feeling sick." | |
51 | |
52 trunc_command fetch chromium | |
53 pcommand cd src | |
54 | |
55 comment "(only on linux)" | |
56 trunc_command ./build/install-build-deps.sh | |
57 | |
58 comment "Pull in all dependencies for HEAD" | |
59 trunc_command gclient sync | |
60 | |
61 comment "Let's fix something!" | |
62 run git new-branch fix_typo | |
63 ed_ws "$ED1" | |
64 run git commit -am 'Fix terrible typo.' | |
65 map | |
66 run git status | |
67 trunc_command git cl upload -r domo@chromium.org --send-mail | |
68 | |
69 comment "While we wait for feedback, let's do something else." | |
70 run git new-branch chap2 | |
71 run git map-branches | |
72 add_ws "$ADD1" | |
73 run git status | |
74 | |
75 comment "Someone on the code review pointed out that our typo-fix has a typo :(" | |
76 comment "We're still working on 'chap2' but we really want to land" | |
77 comment "'fix_typo', so let's switch over and fix it." | |
78 run git freeze | |
79 run git checkout fix_typo 2>&1 | |
80 ed_ws "$ED2" | |
81 run git upstream-diff --wordwise | |
82 run git commit -am 'Fix typo for good!' | |
83 trunc_command git cl upload | |
84 | |
85 comment "Since we got lgtm, let the CQ land it." | |
86 pcommand git cl set_commit | |
87 map | |
88 | |
89 comment "Switch back to where we were using the nav* commands (for fun..." | |
90 comment "git checkout would work here too)" | |
91 run git map-branches | |
92 run git nav-upstream 2>&1 | |
93 pcommand git nav-downstream | |
94 git nav-downstream --pick 0 2>&1 | |
95 run git map-branches | |
96 | |
97 comment "Now we can pick up on chapter2 where we left off." | |
98 run git thaw | |
99 run git diff | |
100 add_ws "$ADD2" | |
101 run git diff | |
102 run git commit -am 'Finish chapter 2' | |
103 map | |
104 trunc_command git cl upload -r domo@chromium.org --send-mail | |
105 | |
106 comment "We poke a committer until they lgtm :)" | |
107 pcommand git cl set_commit | |
108 | |
109 comment "While that runs through the CQ, let's get started on chapter 3." | |
110 comment "Since we know that chapter 3 depends on chapter 2, we'll track the" | |
111 comment "current chapter2 branch." | |
112 run git new-branch --upstream_current chap3 | |
113 add_ws "$ADD3" | |
114 run git commit -am 'beginning of chapter 3' | |
115 map | |
116 | |
117 comment "We haven't updated the code in a while, so let's do that now." | |
118 pcommand git rebase-update | |
119 echo Fetching origin | |
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 | |
122 silent git tag -d $(git tag -l 'stage_*') | |
123 git rebase-update --no_fetch | |
124 | |
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." | |
127 trunc_command gclient sync | |
128 map | |
129 | |
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" | |
132 comment "a code conflict!" | |
133 pcommand git rebase-update | |
134 echo Fetching origin | |
135 git fetch origin 2>&1 | grep -v 'stage' | sed 's+From.*+From https://upstream+' | |
136 silent git tag -d $(git tag -l 'stage_*') | |
137 echo Rebasing: chap2 | |
138 silent git rebase-update | |
139 echo ... lots of output, it\'s a conflict alright :\(... | |
140 run git diff | |
141 | |
142 comment "Oh, well, that's not too bad. In fact... that's a terrible chapter 3!" | |
143 praw \$EDITOR "$WS" | |
144 echo "... /me deletes bad chapter 3 ..." | |
145 silent git checkout --theirs -- "$WS" | |
146 run git add "$WS" | |
147 run git diff --cached | |
148 | |
149 comment "Much better" | |
150 run git rebase --continue | |
151 run git rebase-update | |
152 silent git tag -d $(git tag -l 'stage_*') | |
153 trunc_command gclient sync | |
154 map | |
155 trunc_command git cl upload | |
OLD | NEW |