From: Martin von Zweigbergk Date: Fri, 12 Nov 2010 01:31:08 GMT Subject: Re: [PATCH v2] rebase -X: do not clobber strategy Message-ID: In-Reply-To: <7vpqubfrkj.fsf@alter.siamese.dyndns.org> On Thu, Nov 11, 2010 at 5:01 PM, Junio C Hamano wrote: > Martin von Zweigbergk writes: > >> I don't think there are any merge strategies other than recursive that >> accept options, so what I could add a test case for is that e.g. >> '-s ours -X foo' uses the 'ours' strategy, even though 'foo' will be >> ignored. > > You would do something like this. > > -- >8 -- > Subject: [PATCH] t3402: test "rebase -s -X" > > Signed-off-by: Junio C Hamano > --- >  t/t3402-rebase-merge.sh |   21 +++++++++++++++++++++ >  1 files changed, 21 insertions(+), 0 deletions(-) > > diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh > index 2bea656..be8c1d5 100755 > --- a/t/t3402-rebase-merge.sh > +++ b/t/t3402-rebase-merge.sh > @@ -117,4 +117,25 @@ test_expect_success 'picking rebase' ' >        esac >  ' > > +test_expect_success 'rebase -s funny -Xopt' ' > +       test_when_finished "rm -fr test-bin funny.was.run" && > +       mkdir test-bin && > +       cat >test-bin/git-merge-funny <<-EOF && > +       #!$SHELL_PATH > +       case "\$1" in --opt) ;; *) exit 2 ;; esac > +       shift && > +       >funny.was.run && > +       exec git merge-recursive "\$@" > +       EOF > +       chmod +x test-bin/git-merge-funny && > +       git reset --hard && > +       git checkout -b test-funny master^ && > +       test_commit funny && > +       ( > +               PATH=./test-bin:$PATH > +               git rebase -s funny -Xopt master > +       ) && > +       test -f funny.was.run > +' > + >  test_done > -- > 1.7.3.2.334.gd1031 That's clever. Thank you! The fix for this bug touches the same parts of the code as my refactoring of git rebase. If you don't mind, I will post your test case and the fix as part of the refactoring series.