Re: [PATCH v5 3/4] git-cherry-pick: Add test to validate new options
- From
Neil Horman <nhorman@tuxdriver.com>
- Date
- Apr 16, 2012, 16:50 UTC
- Message-ID
- <20120416165024.GF13366@hmsreliant.think-freely.org>
- In-Reply-To
- <7vvckzws73.fsf@alter.siamese.dyndns.org>
On Mon, Apr 16, 2012 at 09:35:12AM -0700, Junio C Hamano wrote:
Show 30 quoted lines
> Neil Horman <nhorman@tuxdriver.com> writes:
>
> > On Sun, Apr 15, 2012 at 11:39:35AM +0200, Clemens Buchacher wrote:
> > ...
> >> > +test_expect_success 'cherry pick an empty non-ff commit with --allow-empty' '
> >> > + git checkout master && {
> >> > + git cherry-pick --allow-empty empty-branch2
> >> > + }
> >> > +'
> >> > +
> >> > +test_expect_success 'cherry pick with --keep-redundant-commits' '
> >> > + git checkout master && {
> >> > + git cherry-pick --keep-redundant-commits HEAD^
> >> > + }
> >> > +'
> >>
> >> And the expected result is that the HEAD commit is not removed, right?
> >> You should check for that as well.
> >>
> >> Also, please checkout empty-branch2^0 first, in order to make the test
> >> independent of its predecessor.
> >
> > Not sure I follow what your saying here. The expected result with both of these
> > tests is that a new commit is created, referencing the current HEAD as the new
> > HEAD's parent.
>
> If the request were "checkout master^0 first" I would understand. The
> precondition for the second test will be different depending on the first
> one succeeds or not. Perhaps that is what Clemens meant?
> Perhaps, but if so, I'm still not sure how a checkout of empty-branch2^0 affects these tests at all, nor do I grok the relevance to ensuring that the HEAD commit wasn't removed (as AIUI, cherry pick never does that anyway). Clement, can you clarify your thoughts here please? Neil