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

Re: [PATCH v3] replay: drop commits that become empty

From
Elijah Newren <newren@gmail.com>
Date
Dec 16, 2025, 16:36 UTC
Message-ID
<CABPp-BHH2NaLc9tFmO1hKcY4O6jZJU05+65viR1T_yBaarCwrA@mail.gmail.com>
In-Reply-To
<73ba74b8a2e7aaa625e6f0689a9f900ceebaaa03.1765894781.git.phillip.wood@dunelm.org.uk>
On Tue, Dec 16, 2025 at 6:19 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 24 quoted lines
>
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> If the changes in a commit being replayed are already in the branch
> that the commits are being replayed onto, then "git replay" creates an
> empty commit. This is confusing because the commit message no longer
> matches the contents of the commit. Drop the commit instead. Commits
> that start off empty are not dropped. This matches the behavior of
> "git rebase --reapply-cherry-pick --empty=drop" and "git cherry-pick
> --empty-drop".
>
> If a branch points to a commit that is dropped it will be updated
> to point to the last commit that was not dropped. This can be seen
> in the new test where "topic1" is updated to point to the rebased
> "C" as "F" is dropped because it is already upstream. While this is
> a breaking change, "git replay" is marked as experimental to allow
> improvements like this that change the behavior.
>
> Helped-by: Elijah Newren <newren@gmail.com>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> Changes since v2:
>
>  - added a couple of commas to the commit message as suggested by Junio
 - also changes "can been seen" to "can be seen"

I'm also curious if you are keeping the "--only" in the testcase intentionally, or overlooked that part of Junio's feedback.

Anyway, this round looks good to me.
Previous: Phillip WoodNext: Phillip Wood
Message 13 of 16 in “replay: drop commits that become empty”
  1. replay: drop commits that become emptyPhillip Wood, Nov 27, 2025
  2. Junio C HamanoNov 28, 2025
  3. Phillip WoodDec 4, 2025
  4. Elijah NewrenNov 28, 2025
  5. Phillip WoodDec 4, 2025
  6. replay: drop commits that become emptyPhillip Wood, Dec 15, 2025
  7. Junio C HamanoDec 15, 2025
  8. Phillip WoodDec 16, 2025
  9. Phillip WoodDec 17, 2025
  10. Junio C HamanoDec 17, 2025
  11. Elijah NewrenDec 16, 2025
  12. replay: drop commits that become emptyPhillip Wood, Dec 16, 2025
  13. Elijah NewrenDec 16, 2025
  14. Phillip WoodDec 17, 2025
  15. replay: drop commits that become emptyPhillip Wood, Dec 18, 2025
  16. Junio C HamanoDec 19, 2025

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.