[PATCH 16/24] merge script: merge -X<option>

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jonathan Nieder
Date: Tuesday, August 17, 2010 - 12:05 am

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>
---
 contrib/examples/git-merge.sh |    8 +++++++-
 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
-- 
1.7.2.1.544.ga752d.dirty

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 01/24] merge: do not mistake (ancestor of) tag for ..., Jonathan Nieder, (Mon Aug 16, 11:52 pm)
[PATCH 02/24] t7600 (merge): modernize style, Jonathan Nieder, (Mon Aug 16, 11:53 pm)
[PATCH 03/24] t7600 (merge): do not launch gitk for --debug, Jonathan Nieder, (Mon Aug 16, 11:54 pm)
[PATCH 04/24] t7600 (merge): check reflog entry, Jonathan Nieder, (Mon Aug 16, 11:56 pm)
[PATCH 06/24] t6010 (merge-base): modernize style, Jonathan Nieder, (Mon Aug 16, 11:57 pm)
[PATCH 07/24] t6200 (fmt-merge-msg): style nitpicks, Jonathan Nieder, (Mon Aug 16, 11:57 pm)
[PATCH 11/24] fmt-merge-msg -m to override subject line, Jonathan Nieder, (Tue Aug 17, 12:02 am)
[PATCH 14/24] merge script: refuse to merge during merge, Jonathan Nieder, (Tue Aug 17, 12:03 am)
[PATCH 15/24] merge script: improve log message subject, Jonathan Nieder, (Tue Aug 17, 12:04 am)
[PATCH 16/24] merge script: merge -X<option>, Jonathan Nieder, (Tue Aug 17, 12:05 am)
[PATCH 17/24] merge script: allow custom strategies, Jonathan Nieder, (Tue Aug 17, 12:05 am)
[PATCH 18/24] merge script: forbid merge -s index, Jonathan Nieder, (Tue Aug 17, 12:06 am)
[PATCH 19/24] merge script: handle -m --log correctly, Jonathan Nieder, (Tue Aug 17, 12:06 am)
[PATCH 20/24] merge script: handle many-way octopus, Jonathan Nieder, (Tue Aug 17, 12:09 am)
[PATCH 21/24] merge script: --ff-only to disallow true merge, Jonathan Nieder, (Tue Aug 17, 12:10 am)
[PATCH 23/24] merge script: notice @{-1} shorthand, Jonathan Nieder, (Tue Aug 17, 12:11 am)
[PATCH 24/24] merge script: learn --[no-]rerere-autoupdate, Jonathan Nieder, (Tue Aug 17, 12:13 am)
Re: [PATCH 03/24] t7600 (merge): do not launch gitk for -- ..., Ævar Arnfjörð Bjarmason, (Tue Aug 17, 12:31 am)
Re: [PATCH 13/24] merge script: tweak unmerged files messa ..., Ævar Arnfjörð Bjarmason, (Tue Aug 17, 12:36 am)
Re: [PATCH/RFC] updating examples/git-merge (plus a builti ..., Ævar Arnfjörð Bjarmason, (Tue Aug 17, 12:46 am)
Re: [PATCH 19/24] merge script: handle -m --log correctly, Tay Ray Chuan, (Tue Aug 17, 2:55 am)
Re: [PATCH 03/24] t7600 (merge): do not launch gitk for -- ..., Sverre Rabbelier, (Tue Aug 17, 10:50 am)
Re: [PATCH 19/24] merge script: handle -m --log correctly, Jonathan Nieder, (Tue Aug 17, 2:54 pm)
[PATCH 11/24 v2] fmt-merge-msg -m to override merge title, Jonathan Nieder, (Tue Aug 17, 4:00 pm)
Re: [PATCH 03/24] t7600 (merge): do not launch gitk for -- ..., Ævar Arnfjörð Bjarmason, (Wed Aug 18, 1:55 am)