Git development
 help / color / mirror / Atom feed
From: Aniket Gupta <aniketgupta3001@gmail.com>
To: phillip.wood@dunelm.org.uk
Cc: Toon Claes <toon@iotcl.com>, Patrick Steinhardt <ps@pks.im>,
	Junio C Hamano <gitster@pobox.com>,
	Nikita Bobko <nikita@nbobko.com>,
	git@vger.kernel.org
Subject: Re: [PATCH v2] history: refuse to rewrite branches used by other worktrees
Date: Mon, 30 Nov 2026 22:43:04 +0530	[thread overview]
Message-ID: <20261130171304.65061-1-aniketgupta3001@gmail.com> (raw)
In-Reply-To: <644b3ff8-7443-4887-9cea-b649a9382fe1@gmail.com>

> I wonder if branch_used_elsewhere() would better in branch.c and based
> around register_checked_out_branch().

Good idea. I see that branch.c already tracks checkout, rebase, bisect
and --update-refs, so the gap Toon found can be closed without special
cases in history.c. Will do in v3.

> For example "git checkout" calls branch_checked_out() but I think it
> really wants to know if a branch is in use elsewhere.

Checkout goes through die_if_checked_out(), which does not see branches
that another worktree's rebase --update-refs is going to update. How
about keeping checkout out of this patch and looking at it afterwards?

  reply	other threads:[~2026-11-30 17:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 10:39 [PATCH] history: refuse to rewrite branches used by other worktrees Aniket Gupta
2026-11-23 13:10 ` Phillip Wood
2026-11-23 21:54   ` Aniket Gupta
2026-11-24 10:49     ` Phillip Wood
2026-11-24 14:09       ` Aniket Gupta
2026-11-23 20:14 ` Junio C Hamano
2026-11-23 21:54   ` Aniket Gupta
2026-11-27 17:32 ` [PATCH v2] " Aniket Gupta
2026-11-28  0:12   ` Junio C Hamano
2026-11-28  7:37     ` Aniket Gupta
2026-11-30 11:31   ` Toon Claes
2026-11-30 12:15     ` Aniket Gupta
2026-11-30 14:39     ` Phillip Wood
2026-11-30 17:13       ` Aniket Gupta [this message]
2026-11-30 14:49   ` Phillip Wood
2026-11-30 17:13     ` Aniket Gupta

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=20261130171304.65061-1-aniketgupta3001@gmail.com \
    --to=aniketgupta3001@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nikita@nbobko.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    --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