From: Patrick Steinhardt <ps@pks.im>
To: Toon Claes <toon@iotcl.com>
Cc: phillip.wood@dunelm.org.uk, git@vger.kernel.org
Subject: Re: git-history(1) fixup broken with worktrees?
Date: Thu, 20 Aug 2026 15:20:46 +0200 [thread overview]
Message-ID: <aob_LsfI9cO3PewF@pks.im> (raw)
In-Reply-To: <87y0evcjpp.fsf@emacs.iotcl.com>
On Tue, Jul 28, 2026 at 03:44:18PM +0200, Toon Claes wrote:
> 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".
Sorry, I missed this thread for quite a while. In any case, I agree that
we should probably do the same for git-history(1) as well and refuse
updating any branches that are currently checked out in another
worktree.
I've created an issue [1] for this scheduled for the next release cycle.
Happy if anybody else beats us to it though. Thanks!
Patrick
[1]: https://gitlab.com/gitlab-org/git/-/work_items/772
prev parent reply other threads:[~2026-08-20 13:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 18:54 git-history(1) fixup broken with worktrees? Toon Claes
2026-07-18 9:31 ` Phillip Wood
2026-07-28 13:44 ` Toon Claes
2026-08-20 13:20 ` Patrick Steinhardt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aob_LsfI9cO3PewF@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=phillip.wood@dunelm.org.uk \
--cc=toon@iotcl.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox