Re: [PATCH v2] rebase -X: do not clobber strategy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 11, 2010 at 5:01 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Martin von Zweigbergk <martin.von.zweigbergk@xxxxxxxxx> 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<strategy> -X<opt>"
>
> Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
> ---
> Â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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]