🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #4152

Re: [PATCH v2] history: refuse to rewrite branches used by other worktrees

#4152
From: Aniket Gupta
Date: Mon, 30 Nov 2026 17:13
30 lines
12324 bytes
> I'd finish the sentence here.
> [...]
> We don't describe the advice in the documentation of the other
> options so I'd drop it.

Will be done in v3.

> That's true for other worktrees, but not the current worktree where
> the reason is that we'll end up losing work. I'd split it up

We can split it up. A worktree that has the branch checked out can be
left with an index and working tree that no longer match the branch. A
rebase is a different problem which is the same in every worktree,
i.e. if the branch is rewritten during the rebase, "git rebase
--continue" either fails, or throws the rewrite away, and "git rebase
--abort" brings back the old branch. In the docs I will group the
reasons by what is happening to the branch, not by which worktree it is
in.

> A branch that is being bisected in the current worktree cannot be
> rewritten because ... (is there actually a good reason?)

I rewrote the branch by hand while it was being bisected in the current
worktree and in a different one. Bisect could continue and "git bisect
reset" checked out the rewritten branch without problems. One thing I
noticed is that the result points to a commit from the old history,
which is no longer on the branch. I included this check because "git
branch -f" and "git rebase --update-refs" also leave a branch alone
while it is being bisected. I am in favour of keeping it. Suggestions?
Technical Details
Message-ID: <20261130171318.65085-1-aniketgupta3001@gmail.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76715-linux-kernel-git=dewy.ru
References: <20261123103911.98860-1-aniketgupta3001@gmail.com> <20261127173252.7794-1-aniketgupta3001@gmail.com> <03c0d1e1-83c5-4324-b1c9-8023edc4b09e@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76715-linux-kernel-git=dewy.ru
From: aniketgupta3001@gmail.com (Aniket Gupta)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v2] history: refuse to rewrite branches used by other worktrees
Date: Mon, 30 Nov 2026 22:43:18 +0530
Organization: Usenet Network
Message-ID: <20261130171318.65085-1-aniketgupta3001@gmail.com>
References: <20261123103911.98860-1-aniketgupta3001@gmail.com> <20261127173252.7794-1-aniketgupta3001@gmail.com> <03c0d1e1-83c5-4324-b1c9-8023edc4b09e@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1480802"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:KAw/FAk9pBYJXMkCLvjtq7vkjS4= sha256:RAZKBUCNsPtO5hprrjz1Vm02yKVD+SqA4+Kta9WwA94=
	sha1:sZahaAZrgrOc+R5aqcHZx1zW5f8= sha256:7dmu66Y1lYa308u0ZH9MJHu30Ic+/B7SJU347J0k4JQ=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id C1F4C125FF6; Mon, 30 Nov 2026 20:13:40 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id XIJ-fkdmgT47;
	Mon, 30 Nov 2026 20:13:37 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76715-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id D2650125FF5; Mon, 30 Nov 2026 20:13:28 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 730A8316E0; Mon, 30 Nov 2026 17:13:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796058806;
	b=j5QXzU+/sJaXYspeF2LNWMrQeZ16V/ZemM6NpsH0OjVtVfeHr6TvmX20xV3tzMZhZKjN
	 aYhEE77Ni38G9HhNoJp6A85JUl7RObOi3l9+snI46A2Flf7o5weUDnY+4u0uX4f5zm7re
	 KY1LwqNHfc5IcQZO8j4dW/AF6GuWoPzvKXffh9zyISxMJjbBDevbFacbNVYYeJySsZ8YC
	 OG4MoXXP9sbDo2KAQU2aS7eve/oY5CINZAcv+ZAgMxTaXFD/NAasMmIHOa2xTqKS9McyJ
	 Kvr3EUTii0Hbv/wiJMK3gFamLgkmScVlNVu7dQW4qQBNKT7Suvcl2SB3cJzHZgoXRyg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796058806;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:In-Reply-To:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Transfer-Encoding;
	bh=6X3OdWnlVPkl2XgwCn1iSbRIIMUIgm2AwuSzSwuILJY=;
	b=o2isS/gDx5/5/WyZCUKd9d2bAOWIDpxRueEthyaV7oWTEFmggVOyUnBE+LtVBAXwiAw6
	 EC6bOiz62J3zOx4jKJDFvZVvXzMl+0lxOZQr5vgb9F8+JXoQGO++nKhCtIrQJR1tfiRcS
	 /oOvAoziC/PzMFhUNiUTnk3FmGPgJGVTJrdEcG1rHfmqpF67fZJxY/B4yMtrmT+rllCyc
	 b5SRnn/5kzr94HWTquzsHjm4+Wj506z/YrkEPaU9mAmdxsZIuTanCM86PaAjFKNzoOK2O
	 XI77i9hjT9Ggl7MBqFBl/1OHikqy8y4s5LGwghjrnmWTY7/TDx2TbTr+t0KU0TXfVIg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uBr9p2EK;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 4AC49606A31C;
	Mon, 30 Nov 2026 17:13:26 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uBr9p2EK
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.170
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796058805;
	b=NpkinZOy2ltdTAyEOwTR/UZT7tzVl/P+gf6FRvj920SZkIeCHUuxZ30q8ZZOH0n1n2W3
	 1gpSHcZHH4ZT2ZoasdHmsINfU3sV6KVV4rurjUzAtFT/yBpgOptTSkwsjEtOl4N3OXJHY
	 MoLcBKFYb6UU6iPhYt9I0VFGxRUisXV9FrGejktSs8wLkDQRHbIwCwTkoNbuXMiDjfPYd
	 bA4CAKW+7oxlexiIiVyyuILqmz7oY29ax4HukJnCfURz1hsD5Z2CwofbixXaskTHR7IB9
	 cVthfKVD6s8+GQiF+8z+/v+0nkyjwZr+PC9EHCL2O9UiUflUJXdGJqiN632lIOqb8lQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796058805;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 MIME-Version:Content-Transfer-Encoding;
	bh=6X3OdWnlVPkl2XgwCn1iSbRIIMUIgm2AwuSzSwuILJY=;
	b=c4dZXVDCfybWhmm+7GprOpX+hEIgs72eP1M6Rpi4Ul/M/bkINPDZMAvyjdXKw627VpQO
	 BJDUHyaTeWa6kfWfRz0qrQFHT0rRWi/KrQDxErmqHGssrxF88RGJf5JGnQ5iU+wJHR+E8
	 KvyUiSrRIXXTD9O2FEnB+9j8ojUpS4irnRnMxtGWPRk7GrZDPOhxutuon5ZTohUZFCEZ0
	 hSs6W6MALzB0EiYTtrg6sa/Nz7eHk5FXYxWu4DOXsF5Ofjc0Mupu7/b4WqlTO0TfEUHZH
	 H/Y4s/Y/1OKheutWbkTN+kGfCg1/jGvlKHj2uYTYHQDVulJdKJJ3hg9jaEhdoPK2DQg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=uBr9p2EK;
	arc=none smtp.remote-ip=209.85.214.170
X-Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21F78606A32E
	for <git@vger.kernel.org>; Mon, 30 Nov 2026 17:13:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 21F78606A32E
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2f0621eec70so77508635ad.2
        for <git@vger.kernel.org>; Mon, 30 Nov 2026 09:13:25 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796058804; x=1796663604; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=6X3OdWnlVPkl2XgwCn1iSbRIIMUIgm2AwuSzSwuILJY=;
        b=uBr9p2EKWPFZQCVvKZ5x30B+cmD/EbKSolriUoD8tEZNptIsHGDTw/fGopmyRhio5a
         JXABHJrpKHe2qE4bFdQe+YlnQ44Jx4SSZAIjw1lppy6OO2h9TKpzoMOO0ivjcJjNLDIy
         0aV4Q7Mv248fbjWr076WCTNJxd76OphZxlk8m5H5z43nx7XhS1Ad6metkZ0mEKBjpuqT
         OsVLdngVrgmFAbtUp7nmHwwXMISXtePyDtxG0rQcxFDWbGcXi5KlOkWLevmSmZ2A/IgV
         +BOgENNyt6R1YrF1MKlEjGfQWkptWlpHQTcpkcMUw9Vt6IItfvQiAl5CJ2sgM5qO4cst
         nu5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796058804; x=1796663604;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from
         :to:cc:subject:date:message-id:reply-to:content-type;
        bh=6X3OdWnlVPkl2XgwCn1iSbRIIMUIgm2AwuSzSwuILJY=;
        b=0mBK43mIzvgkjNRPf0yqHoOisZczrfBt3ucGd0KXA4zC9OV0PoywQNapULDRpgvnc3
         uoZInZRxJsn1ZQGcHhnEoHA/KOUSTLsOgkTMavQB8gAZHlTLjLfkEBYIbP0DVXk6P+IA
         SYw9SBjYhGleLEzM18cHMX79fbIyvlQAe+294i/z7u3yebh3rj3BgtowMz9Pw6NCGLLj
         YMlg49hZpduf8SBilD2MEK7odL3ZyjlF9oU1Y1b417pjrAuxYBQCmJJ8sXIOJRNNIcuM
         icp1EZnXt8+9XUSKmOccYDFSSeD9lB9K7wzg2LXcQ8VLx7cNLwqxE9ZfYmQFYbwVlynD
         RNfg==
X-Forwarded-Encrypted: i=1; AL+hErG1RRd+7SZOqgdsTf7tUcvBK0ZfgS8PJXZVrSov7E9wQvEJZcSRJdJBJ4VZDuMzZSTeV94=@vger.kernel.org
X-Gm-Message-State: APuU4Z93Zlp47lpojiXcdZqujLxGH6co+R9lXtjbqX667C+cIqDt5bwx
	XiUCHIrnewSddMUSakKWno5Q6hNlq5xxx8ESatryc+LDOn/9aTK7reKs5Po4ZYSpAfw=
X-Gm-Gg: AZFdTZdJgJKQxtkQPW15ML/fNJrnWgV9tqR6YC4gPbOiQpN18ysEF2Cqbz0naD7dx32
	ncUiksWoOQEWwDVPuod55Aqr7+qqXV1NFvclonBjN8RmWSTggef/Jq+6OS2GZ44KJrf5Sha1Gz2
	Pa93HribP0sk7XasGYog4h3/Ydx/0EMl/zpBvELGZyfNWqexQIrMIhUVbXAhb72dkyPiXRVTgRb
	WlT/NWDK9V4UqAKkYcTkD0ow3fkw8c7e2l/zFbv4Juxz6mVfcwx2U0CLH5ldeuSIIrPr6Mozpvb
	tmREt6oX6Rnxz2zKKNaU9BAqoF613zqwiW1peTIbzHRWIg38NUndeI8CbLxMlybx3UvEP/7b1cI
	8TJJhQJv2lH0vvUKjzDj2fW/806hmjKAlCyC8UAYDe/mmbwCYGYxWQhjNLcFl9JJcj14VT0H1dc
	Z7zuJwjEUjhz7Euzppr/XwxiPPJw4YDiBn5ZDdco2K9A4B6Uvm1h5vkZqm1iZST6WpmFpP1dlsa
	Tyeppxm5HNMyVfXQGlz+H8D0+WtR5C59YuM3qgwlAswtnB9hZBIEtfLhsNZ6YDi4XAipNQzCYrx
	uO2y7Khd5vKgTa64Vmm/RcH6kP+I5X9vb9+3XtyubG7VzR5UdHu7kahEAJVxjA3grKzwbNE0CQj
	uGaZX6Fupd/+qzHMyrmhJYVMCqmFGAo24jju6Sku8WA0=
X-Received: by 2002:a17:90b:17cd:b0:3ab:4f1:4f76 with SMTP id 98e67ed59e1d1-3b41c900b24mr34651916a91.24.1796058804399;
        Mon, 30 Nov 2026 09:13:24 -0800 (PST)
X-Received: from localhost.localdomain ([103.25.231.125])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5639e13f7sm10918875a91.12.2026.11.30.09.13.21
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Mon, 30 Nov 2026 09:13:23 -0800 (PST)
X-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
X-Mailer: git-send-email 2.54.0
X-In-Reply-To: <03c0d1e1-83c5-4324-b1c9-8023edc4b09e@gmail.com>
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list