merge script: merge -X<option>
Without this support, the scripted merge cannot pass t6037. Based on v1.7.0-rc0~55^2~5 (git merge -X<option>, 2009-11-25). 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:05 UTC
5d75a52b3a8870c3c1b27c5d791da5c9267e1fb5
1 file changed
+7
-1
contrib/examples/git-merge.sh
+7
-1
@@ -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
s,strategy= merge strategy to use
19
+X= option for selected merge strategy
20
m,message= message to be used for the merge commit (if any)
21
"
22
@@ -40,6 +41,7 @@ default_octopus_strategies='octopus'
41
no_fast_forward_strategies='subtree ours'
42
no_trivial_strategies='recursive recur subtree ours recursive-ours recursive-theirs'
43
use_strategies=
44
+xopt=
45
46
allow_fast_forward=t
47
allow_trivial_merge=t
@@ -196,6 +198,10 @@ parse_config () {
198
die "available strategies are: $all_strategies" ;;
199
esac
200
;;
201
+ -X)
202
+ shift
203
+ xopt="${xopt:+$xopt }$(git rev-parse --sq-quote "--$1")"
204
+ ;;
205
-m|--message)
206
shift
207
merge_msg="$1"
@@ -469,7 +475,7 @@ do
475
# Remember which strategy left the state in the working tree
476
wt_strategy=$strategy
477
472
- git-merge-$strategy $common -- "$head_arg" "$@"
478
+ eval 'git-merge-$strategy '"$xopt"' $common -- "$head_arg" "$@"'
479
exit=$?
480
if test "$no_commit" = t && test "$exit" = 0
481
then