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

Re: git-history(1) fixup broken with worktrees?

From
Toon Claes <toon@iotcl.com>
Date
Jul 28, 2026, 13:44 UTC
Message-ID
<87y0evcjpp.fsf@emacs.iotcl.com>
In-Reply-To
<e7dbcede-4486-459c-aa64-e44690e01fe0@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
> I think what's happening is that the branch "feature" is updated because 
> the commit it points to is rewritten, but the index and working copy in 
> the work tree "feature" are not.

Yeah, it's relatively easy to understand what goes wrong, the fix would be a bit more involved.

> Rebase's --update-refs option refuses to update branches that are
> checked out in other workers by default to avoid exactly this
> problem[1].
Ah, thanks for finding this existing discussion, interesting.
> As you can see in that thread there was some discussion about updating
> the index and working copy when the work tree is clean instead. I
> think that is a friendlier approach as it preserves the relationships
> between branches and avoids materializing changes in other worktrees.

Yeah, I agree it would be nice if git-history(1) would give it their "best-effort".

> On a related note, rebase refuses to rewrite a branch that is being 
> rewritten by another rebase running in a different work tree. That's an 
> important safety measure that I think the history command is missing.

From [2] I've learned there are multiple ways a branch can be checked out. We have to take them all into account. It can be build on top of the changes in that patch.

[2]: https://lore.kernel.org/git/590382fb-731b-4e14-911e-ff68356d1082@web.de
-- 
Cheers,
Toon
Previous: Phillip WoodNext: Patrick Steinhardt
Message 3 of 4 in “git-history(1) fixup broken with worktrees?”
  1. Toon ClaesJul 17, 2026
  2. Phillip WoodJul 18, 2026
  3. Toon ClaesJul 28, 2026
  4. Patrick SteinhardtAug 20, 2026

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.