Meta/Reintegrate: try keeping the cut points with comments
Using empty commits on the throw-away trial integration branches, keep track of the "doneness" comments in the history, so that later run of "redo-*.sh -[ud]" can resurrect them.
Junio C Hamano committed
Jan 8, 2013 at 16:11 UTC
f02bf6b48bb5c2585ae73485f26d0e959a74e935
1 file changed
+24
-4
Reintegrate
+24
-4
@@ -83,18 +83,25 @@ no)
83
fi
84
}
85
86
- cut_seen=0
86
+ mark_cut () {
87
+ test -z "$prev_cut" && return
88
+ git commit --allow-empty -m "$prev_cut"
89
+ prev_cut=
90
+ }
91
+
92
+ cut_seen=0 prev_cut=
93
while read branch eh
94
do
95
case "$branch" in '###') cut_seen=$(( $cut_seen + 1 )) ;; esac
96
if test -n "$stop_at_cut" && test $stop_at_cut -le $cut_seen
97
then
92
- continue
98
+ continue ;# slurp the remainder and skip
99
fi
100
101
case "$branch" in
102
'###')
97
- echo >&2 "$branch"
103
+ echo >&2 "$branch $eh"
104
+ prev_cut="$branch $eh"
105
continue ;;
106
'#'* | '')
107
continue ;;
@@ -109,6 +116,8 @@ no)
116
mb=$(git merge-base "$tip" "$save")
117
test "$mb" = "$tip" && continue
118
119
+ mark_cut
120
+
121
EDITOR=: git merge $accept_rerere --edit "$branch" ||
122
accept_rerere ||
123
exit
@@ -130,6 +139,9 @@ no)
139
;;
140
pick" "*)
141
echo >&2 "* $eh"
142
+
143
+ mark_cut
144
+
145
git cherry-pick "$branch" || exit ;;
146
*) echo >&2 "Eh? $branch $eh"; exit ;;
147
esac
@@ -175,7 +187,15 @@ show_merge () {
187
}
188
189
show_pick () {
178
- merged="$(git rev-parse --verify "$commit") pick $msg"
190
+ case "$msg" in
191
+ "### "* | "###")
192
+ merged="$msg"
193
+ ;;
194
+ *)
195
+ merged="$(git rev-parse --verify "$commit") pick $msg"
196
+ ;;
197
+ esac
198
+
199
}
200
201
generate () {