git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Stephen HabermanNext: Stephen Haberman
Message 9 of 11 in “rebase-i-p: squashing and limiting todo”
  1. rebase-i-p: squashing and limiting todoStephen Haberman, Oct 8, 2008
  2. rebase-i-p: test to exclude commits from todo based on its parentsStephen Haberman, Oct 8, 2008
  3. rebase-i-p: use HEAD for updating the ref instead of mapping OLDHEADStephen Haberman, Oct 8, 2008
  4. rebase-i-p: delay saving current-commit to REWRITTEN if squashingStephen Haberman, Oct 8, 2008
  5. rebase-i-p: fix 'no squashing merges' tripping up non-mergesStephen Haberman, Oct 8, 2008
  6. rebase-i-p: only list commits that require rewriting in todoStephen Haberman, Oct 8, 2008
  7. rebase-i-p: do not include non-first-parent commits touching UPSTREAMStephen Haberman, Oct 8, 2008
  8. rebase-i-p: if todo was reordered use HEAD as the rewritten parentStephen Haberman, Oct 8, 2008
  9. Junio C HamanoOct 8, 2008
  10. Stephen HabermanOct 9, 2008
  11. Stephen HabermanOct 8, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.