{"thread":{"id":"22853","subject":"[PATCH] Support merge strategy options in rebase","startedAt":"2010-02-28T04:43:27Z","lastAt":"2010-02-28T21:17:45Z","messageCount":2,"participants":["Mike Lundy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"135867","messageId":"1267332207-22675-1-git-send-email-mike@fluffypenguin.org","threadId":"22853","inReplyTo":null,"subject":"[PATCH] Support merge strategy options in rebase","fromName":"Mike Lundy","fromEmail":"mike@fluffypenguin.org","sentAt":"2010-02-28T04:43:27Z","receivedAt":"2010-02-28T04:43:27Z","isPatch":true,"sender":{"key":"mike@fluffypenguin.org","avatar":null},"body":"The manpage says that git-rebase supports merge strategies, but the rebase\ncommand doesn't know about -X, and gives the usage when presented with it.\n\nSigned-off-by: Mike Lundy <mike@fluffypenguin.org>\n---\n\n My test modification only makes sure that the argument is accepted; it assumes\n merge strategies are already tested and they won't actually be needed, because\n there's no conflict.\n\n git-rebase.sh           |   15 ++++++++++++++-\n t/t3402-rebase-merge.sh |    3 ++-\n 2 files changed, 16 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex fb4fef7..c2a92af 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -44,6 +44,7 @@ To restore the original branch and stop rebasing run \\\"git rebase --abort\\\".\n \"\n unset newbase\n strategy=recursive\n+strategy_opts=\n do_merge=\n dotest=\"$GIT_DIR\"/rebase-merge\n prec=4\n@@ -111,7 +112,7 @@ call_merge () {\n \tthen\n \t\texport GIT_MERGE_VERBOSITY=1\n \tfi\n-\tgit-merge-$strategy \"$cmt^\" -- \"$hd\" \"$cmt\"\n+\tgit-merge-$strategy $strategy_opts \"$cmt^\" -- \"$hd\" \"$cmt\"\n \trv=$?\n \tcase \"$rv\" in\n \t0)\n@@ -295,6 +296,18 @@ do\n \t-M|-m|--m|--me|--mer|--merg|--merge)\n \t\tdo_merge=t\n \t\t;;\n+\t-X*|--strategy-option*)\n+\t\tcase \"$#,$1\" in\n+\t\t*,*=*)\n+\t\t\tstrategy_opts=\"$strategy_opts --`expr \"z$1\" : 'z-[^=]*=\\(.*\\)'`\" ;;\n+\t\t1,*)\n+\t\t\tusage ;;\n+\t\t*)\n+\t\t\tstrategy_opts=\"$strategy_opts --$2\"\n+\t\t\tshift ;;\n+\t\tesac\n+\t\tdo_merge=t\n+\t\t;;\n \t-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\\\n \t\t--strateg=*|--strategy=*|\\\n \t-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)\ndiff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh\nindex 7b7d072..f273a37 100755\n--- a/t/t3402-rebase-merge.sh\n+++ b/t/t3402-rebase-merge.sh\n@@ -51,7 +51,8 @@ test_expect_success 'reference merge' '\n PRE_REBASE=$(git rev-parse test-rebase)\n test_expect_success rebase '\n \tgit checkout test-rebase &&\n-\tGIT_TRACE=1 git rebase --merge master\n+\tGIT_TRACE=1 git rebase --merge master &&\n+\tGIT_TRACE=1 git rebase --merge -X theirs master\n '\n \n test_expect_success 'test-rebase@{1} is pre rebase' '\n-- \n1.7.0.95.g91ec93\n"},{"id":"135898","messageId":"7vaautvz46.fsf@alter.siamese.dyndns.org","threadId":"22853","inReplyTo":"1267332207-22675-1-git-send-email-mike@fluffypenguin.org","subject":"Re: [PATCH] Support merge strategy options in rebase","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-02-28T21:17:45Z","receivedAt":"2010-02-28T21:17:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Lundy <mike@fluffypenguin.org> writes:\n\n> The manpage says that git-rebase supports merge strategies, but the rebase\n> command doesn't know about -X, and gives the usage when presented with it.\n>\n> Signed-off-by: Mike Lundy <mike@fluffypenguin.org>\n> ---\n>\n>  My test modification only makes sure that the argument is accepted; it assumes\n>  merge strategies are already tested and they won't actually be needed, because\n>  there's no conflict.\n\nHow well does this work when strategy options need to contain a\nwhitespace?\n"}]}