summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-17 07:05:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-18 21:02:04 (GMT)
commit5d75a52b3a8870c3c1b27c5d791da5c9267e1fb5 (patch)
tree75bdcb839fcc8952af596c408f2ac25cde9bf166
parent13dd255e4abb95895aaef72e2b93564be90cb49c (diff)
downloadgit-5d75a52b3a8870c3c1b27c5d791da5c9267e1fb5.zip
git-5d75a52b3a8870c3c1b27c5d791da5c9267e1fb5.tar.gz
git-5d75a52b3a8870c3c1b27c5d791da5c9267e1fb5.tar.bz2
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>
-rwxr-xr-xcontrib/examples/git-merge.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh
index d491566..0d53735 100755
--- a/contrib/examples/git-merge.sh
+++ b/contrib/examples/git-merge.sh
@@ -16,6 +16,7 @@ squash create a single commit instead of doing a merge
commit perform a commit if the merge succeeds (default)
ff allow fast-forward (default)
s,strategy= merge strategy to use
+X= option for selected merge strategy
m,message= message to be used for the merge commit (if any)
"
@@ -40,6 +41,7 @@ default_octopus_strategies='octopus'
no_fast_forward_strategies='subtree ours'
no_trivial_strategies='recursive recur subtree ours recursive-ours recursive-theirs'
use_strategies=
+xopt=
allow_fast_forward=t
allow_trivial_merge=t
@@ -196,6 +198,10 @@ parse_config () {
die "available strategies are: $all_strategies" ;;
esac
;;
+ -X)
+ shift
+ xopt="${xopt:+$xopt }$(git rev-parse --sq-quote "--$1")"
+ ;;
-m|--message)
shift
merge_msg="$1"
@@ -469,7 +475,7 @@ do
# Remember which strategy left the state in the working tree
wt_strategy=$strategy
- git-merge-$strategy $common -- "$head_arg" "$@"
+ eval 'git-merge-$strategy '"$xopt"' $common -- "$head_arg" "$@"'
exit=$?
if test "$no_commit" = t && test "$exit" = 0
then