merge script: learn --[no-]rerere-autoupdate
Port v1.7.0-rc0~83^2 (Teach --[no-]rerere-autoupdate option to merge, revert and friends, 2009-12-04) to the example merge script. After this change, all tests pass for me with the scripted merge. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
Aug 17, 2010 at 02:13 UTC
fdc4408a8980392f2cc30dc125906a61edf170ec
1 file changed
+5
-2
contrib/examples/git-merge.sh
+5
-2
@@ -16,6 +16,7 @@ squash create a single commit instead of doing a merge
16
commit perform a commit if the merge succeeds (default)
17
ff allow fast-forward (default)
18
ff-only abort if fast-forward is not possible
19
+rerere-autoupdate update index with any reused conflict resolution
20
s,strategy= merge strategy to use
21
X= option for selected merge strategy
22
m,message= message to be used for the merge commit (if any)
@@ -48,7 +49,7 @@ xopt=
49
allow_fast_forward=t
50
fast_forward_only=
51
allow_trivial_merge=t
51
-squash= no_commit= log_arg=
52
+squash= no_commit= log_arg= rr_arg=
53
54
dropsave() {
55
rm -f -- "$GIT_DIR/MERGE_HEAD" "$GIT_DIR/MERGE_MSG" \
@@ -200,6 +201,8 @@ parse_config () {
201
test "$allow_fast_forward" != f ||
202
die "You cannot combine --ff-only with --no-ff."
203
fast_forward_only=t ;;
204
+ --rerere-autoupdate|--no-rerere-autoupdate)
205
+ rr_arg=$1 ;;
206
-s|--strategy)
207
shift
208
case " $all_strategies " in
@@ -612,6 +615,6 @@ Conflicts:
615
sed -e 's/^[^ ]* / /' |
616
uniq
617
} >>"$GIT_DIR/MERGE_MSG"
615
- git rerere
618
+ git rerere $rr_arg
619
die "Automatic merge failed; fix conflicts and then commit the result."
620
fi