summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-08-18 12:29:47 -0700
committerJunio C Hamano <gitster@pobox.com>2010-08-18 12:29:47 -0700
commit06d11b2e8d9d78d01212024f0f410e4193cbb5bd (patch)
treeb0deab7259afb582a269aadce0547a5f9ee18b44 /git-rebase.sh
parent226d06c16bcafda3417163437be9845130fd4998 (diff)
parent93ce190cd16b4c5ff16cc000eb75bd6e6c3238ac (diff)
downloadgit-06d11b2e8d9d78d01212024f0f410e4193cbb5bd.tar.gz
Merge branch 'ml/rebase-x-strategy'
* ml/rebase-x-strategy: rebase: support -X to pass through strategy options
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-xgit-rebase.sh24
1 files changed, 23 insertions, 1 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 1b9ea48cd7..7508463b30 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -44,6 +44,7 @@ To restore the original branch and stop rebasing run \"git rebase --abort\".
"
unset newbase
strategy=recursive
+strategy_opts=
do_merge=
dotest="$GIT_DIR"/rebase-merge
prec=4
@@ -112,7 +113,7 @@ call_merge () {
then
export GIT_MERGE_VERBOSITY=1
fi
- git-merge-$strategy "$cmt^" -- "$hd" "$cmt"
+ eval 'git-merge-$strategy' $strategy_opts '"$cmt^" -- "$hd" "$cmt"'
rv=$?
case "$rv" in
0)
@@ -294,6 +295,27 @@ do
-M|-m|--m|--me|--mer|--merg|--merge)
do_merge=t
;;
+ -X*|--strategy-option*)
+ case "$#,$1" in
+ 1,-X|1,--strategy-option)
+ usage ;;
+ *,-X|*,--strategy-option)
+ newopt="$2"
+ shift ;;
+ *,--strategy-option=*)
+ newopt="$(expr " $1" : ' --strategy-option=\(.*\)')" ;;
+ *,-X*)
+ newopt="$(expr " $1" : ' -X\(.*\)')" ;;
+ 1,*)
+ usage ;;
+ esac
+ strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--$newopt")"
+ do_merge=t
+ if test -n "$strategy"
+ then
+ strategy=recursive
+ fi
+ ;;
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
--strateg=*|--strategy=*|\
-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)