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

Re: [BUG] git-rebase: reword squashes commits in case of merge-conflicts

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 17, 2018, 03:36 UTC
Message-ID
<CAPig+cRKxpNrTNSEgB66LBxcJk1b24ViR=T-fkqo07wxMFywpQ@mail.gmail.com>
In-Reply-To
<20180616160804.10914-1-newren@gmail.com>
On Sat, Jun 16, 2018 at 12:08 PM Elijah Newren <newren@gmail.com> wrote:
Show 8 quoted lines
> Subject: [PATCH] sequencer: do not squash 'reword' commits when we hit
>  conflicts
> [...]
> Signed-off-by: Elijah Newren <newren@gmail.com>
> ---
> diff --git a/t/t3423-rebase-reword.sh b/t/t3423-rebase-reword.sh
> @@ -0,0 +1,44 @@
> +test_expect_success 'reword comes after a conflict preserves commit' '
s/comes//
Show 5 quoted lines
> +       git checkout stuff^0 &&
> +
> +       set_fake_editor &&
> +       test_must_fail env FAKE_LINES="reword 2" \
> +               git rebase -i -v master &&

If some command fails between here and "git rebase --continue" below, then the test will exit with an in-progress (dangling) rebase, which could confuse tests added later to this script. I wonder, therefore, if it would make sense to insert the following cleanup before "git rebase -i":

    test_when_finished "reset_rebase" &&
Show 7 quoted lines
> +       git checkout --theirs file-2 &&
> +       git add file-2 &&
> +       FAKE_COMMIT_MESSAGE="feature_b_reworded" git rebase --continue &&
> +
> +       test "$(git log -1 --format=%B)" = "feature_b_reworded" &&
> +       test $(git rev-list --count HEAD) = 2
> +'
Previous: Elijah NewrenNext: Elijah Newren
Message 5 of 19 in “[BUG] git-rebase: reword squashes commits in case of merge-conflicts”
  1. chJun 11, 2018
  2. Jeff KingJun 12, 2018
  3. chJun 15, 2018
  4. Elijah NewrenJun 16, 2018
  5. Eric SunshineJun 17, 2018
  6. sequencer: do not squash 'reword' commits when we hit conflictsElijah Newren, Jun 17, 2018
  7. Phillip WoodJun 17, 2018
  8. Johannes SchindelinJun 17, 2018
  9. Phillip WoodJun 18, 2018
  10. Junio C HamanoJun 18, 2018
  11. Johannes SchindelinJun 18, 2018
  12. Phillip WoodJun 19, 2018
  13. sequencer: do not squash 'reword' commits when we hit conflictsPhillip Wood, Jun 19, 2018
  14. Elijah NewrenJun 19, 2018
  15. Junio C HamanoJun 19, 2018
  16. t/lib-rebase.sh: support explicit 'pick' commands in 'fake_editor.sh'SZEDER Gábor, Aug 23, 2018
  17. Junio C HamanoAug 23, 2018
  18. Johannes SchindelinAug 23, 2018
  19. Johannes SchindelinJun 17, 2018

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.