Re: [PATCH v2 RFC] rebase-i-p: test to exclude commits from todo based on its parents
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 8, 2008, 07:24 UTC
- Message-ID
- <7vmyhfr1lb.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <e5ababa1de420b6460fd856679990c9dd2caf1d1.1223445353.git.stephen@exigencecorp.com>
Stephen Haberman <stephen@exigencecorp.com> writes:
Show 22 quoted lines
> +# set up two branches like this: > +# > +# A1 - B1 - D1 - E1 - F1 > +# \ / > +# -- C1 -- > ... > +test_expect_success 'setup' ' > ... > +' > + > +# Should result in: > +# > +# A1 - B1 - D2 - E2 > +# \ / > +# -- C1 -- > +# > +test_expect_success 'squash F1 into D1' ' > + FAKE_LINES="1 squash 3 2" git rebase -i -p B1 && > + test "$(git rev-parse HEAD^2)" = "$(git rev-parse branch)" && > + test "$(git rev-parse HEAD~2)" = "$(git rev-parse B1)" && > + git tag E2 > +'
Very nicely written test sequence with pictures. I wish all the tests were written like this.
Show 11 quoted lines
> +# Start with: > +# > +# A1 - B1 - D2 - E2 > +# \ > +# G1 ---- L1 ---- M1 > +# \ / > +# H1 -- J1 -- K1 > +# \ / > +# -- I1 -- > +# > +# And rebase G1..M1 onto E3
I think s/E3/E2/ is what you meant.
If this is the first one in the series, you may want to mark these tests with test_expect_failure and make a later patch that changes the behaviour of rebase-i-p include updates to the test script to turn expect-failure into expect-success.