From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Gabriel Scherer <gabriel.scherer@inria.fr>,
git@vger.kernel.org, "D. Ben Knoble" <ben.knoble@gmail.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH 2/3] rebase: support --ignore-other-worktrees
Date: Mon, 15 Sep 2025 09:23:19 -0700 [thread overview]
Message-ID: <xmqq8qifit1k.fsf@gitster.g> (raw)
In-Reply-To: <779ec8b7-9939-4860-bdc2-6d620ecfad24@gmail.com> (Phillip Wood's message of "Mon, 15 Sep 2025 11:09:48 +0100")
Phillip Wood <phillip.wood123@gmail.com> writes:
> Hi Gabriel
>
> On 13/09/2025 15:13, Gabriel Scherer wrote:
>> From: "Gabriel.Scherer" <gabriel.scherer@inria.fr>
>> rebase can currently fail if the branch to rebase is checked out in
>> another worktree, and there is no way for users to override this
>> error. We add support for the '--ignore-other-worktrees' option of
>> 'checkout'.
>
> I'm not sure we want to be encouraging users to rebase a branch that
> is already checked out in another worktree. Unlike the checkout case
> where they maybe just reading the code and not updating the branch,
> rebase will update the branch which is going to be confusing. We
> could, perhaps, add a hint suggesting that if they are making
> experimental changes, they might want to rebase a detached HEAD
> instead with
>
> git rebase <upstream> <branch>^0
>
> but I'm not sure if that is helpful or if using a detached HEAD will
> just confuse users.
The risk of confusion is real in a workflow like this. Hinting them
to go to that existing worktree that is used to checkout that branch
and rebasing it there might be less risky.
But stepping back a bit, if the user reader wants to rebase the
branch in this worktree, instead of in the other worktree, is
because they has uncommitted changes in the worktree that already
checks out the branch, the branch may not even be ready to be
rebased?
Thanks.
next prev parent reply other threads:[~2025-09-15 16:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-13 14:13 [PATCH 0/3] extend --ignore-other-worktrees to 'rebase', add hints Gabriel Scherer
2025-09-13 14:13 ` [PATCH 1/3] checkout: provide hint when failing due to another worktree Gabriel Scherer
2025-09-13 20:55 ` Kristoffer Haugsbakk
2025-09-14 7:50 ` Gabriel Scherer
2025-09-15 8:53 ` Junio C Hamano
2025-09-15 19:52 ` Gabriel Scherer
2025-09-16 5:32 ` Junio C Hamano
2025-09-17 14:17 ` Junio C Hamano
2025-09-17 15:25 ` Gabriel Scherer
2025-09-19 14:13 ` Phillip Wood
2025-09-14 19:03 ` Ben Knoble
2025-09-14 19:06 ` Ben Knoble
2025-09-14 19:32 ` Kristoffer Haugsbakk
2025-09-13 14:13 ` [PATCH 2/3] rebase: support --ignore-other-worktrees Gabriel Scherer
2025-09-15 10:09 ` Phillip Wood
2025-09-15 16:23 ` Junio C Hamano [this message]
2025-09-13 14:13 ` [PATCH 3/3] rebase: hint when failing on branch used by another worktree Gabriel Scherer
2025-09-13 19:30 ` [PATCH 0/3] extend --ignore-other-worktrees to 'rebase', add hints Ben Knoble
2025-09-13 20:02 ` Gabriel Scherer
2025-09-15 10:09 ` Phillip Wood
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=xmqq8qifit1k.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=gabriel.scherer@inria.fr \
--cc=git@vger.kernel.org \
--cc=phillip.wood123@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).