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

Re: [RFC] git-rebase-clean: mitigating a “semantic conflict cascade” during rebase

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Sep 16, 2025, 22:14 UTC
Message-ID
<aMnhSm5QSdRwiJds@fruit.crustytoothpaste.net>
In-Reply-To
<CACEPZDXGGn0S_8PpEc=BVHhvyuZhWfiDmbxNOK7iPWJOj1jrXg@mail.gmail.com>
On 2025-09-16 at 21:39:46, Antonio Mennillo wrote:
> Hi Git community,
Hi,
Show 9 quoted lines
> Problem (observation, possibly a known limitation rather than a bug):
> When rebasing feature branches whose commits are semantically interdependent,
> Git replays commits one by one. In practice this can trigger a
> cascading conflict, similar to a loop. Example:
> 
>  - Commit 1: add interface IUserService
>  - Commit 6: add UserServiceImpl (depends on 1)
>  - Commit 11: change IUserService signature
>  - Commits 12–15: update implementation/tests to match

Usually we would recommend that each commit be atomic. That is, each commit should compile and pass all of the tests, so commits 12–15 would be part of commit 11.

Show 5 quoted lines
> During rebase, conflicts may appear at 1 and again at 6/11, forcing the user to
> remember prior resolutions and reconstruct intent across commits. If I’m
> mischaracterizing the model, I’d appreciate a correction. I’m sharing this
> humbly to verify whether this is expected behavior or if there is prior art I
> should be aware of.

Are you familiar with `git rerere`? I have just done a complicated rebase of this sort and it remembers resolutions for you so you don't have to.

Show 7 quoted lines
> Mitigation (userland workflow): I built `git-rebase-clean`, which
> squashes the feature branch first and then rebases. This concentrates
> conflict resolution into a single atomic step with the full final
> context visible. The obvious trade-off is commit history granularity:
> you lose individual commits but gain atomic conflict resolution. In my
> experience this reduces repeated/conflicting resolutions across
> dependent commits.

I think most people on this list will consider losing the history unacceptable, so I don't think this is a thing we'll want to encourage.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Antonio MennilloNext: Antonio Mennillo
Message 2 of 8 in “[RFC] git-rebase-clean: mitigating a “semantic conflict cascade” during rebase”
  1. Antonio MennilloSep 16, 2025
  2. brian m. carlsonSep 16, 2025
  3. Antonio MennilloSep 18, 2025
  4. brian m. carlsonSep 18, 2025
  5. Antonio MennilloSep 19, 2025
  6. Elijah NewrenSep 20, 2025
  7. Antonio MennilloSep 21, 2025
  8. Antonio MennilloSep 23, 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.