Meta/Reintegrate: allow each step to be optionally amended
This will let me run 'Meta/Reintegrate -e' and feed the selected branches while on 'master', i.e. the final graduation ceremony, and clean up the merge messages.
Junio C Hamano committed
Mar 16, 2012 at 13:04 UTC
370023272cdce6020e439e70879d90455d4cc75e
1 file changed
+5
-2
Reintegrate
+5
-2
@@ -1,10 +1,11 @@
1
#!/bin/sh
2
3
-accept_rerere="--rerere-autoupdate" generate=no update= diff=
3
+accept_rerere="--rerere-autoupdate" generate=no update= diff= edit=
4
while case "$#,$1" in 0,*) break;; *,-*) ;; esac
5
do
6
case "$1" in
7
-n) accept_rerere= ;;
8
+ -e) edit=t ;;
9
-d) update=${2?"diff with what?"}
10
diff=yes
11
generate=yes
@@ -66,7 +67,7 @@ annotate_merge () {
67
case "$generate" in
68
no)
69
accept_rerere () {
69
- if ! git write-tree 2>/dev/null
70
+ if ! git write-tree 2>/dev/null >/dev/null
71
then
72
git rerere remaining
73
return 1
@@ -94,6 +95,8 @@ no)
95
exit
96
97
annotate_merge "$branch" || exit
98
+ test -z "$edit" ||
99
+ git commit --amend || exit
100
101
this=$(git rev-parse --verify HEAD)
102
if test "$this" = "$save"