πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #587

Re: [PATCH 1/3] reflog: name the strings that mark switches, renames and rebase steps

#587
From: "Kristoffer Haugsbakk"
Date: Thu, 15 Oct 2026 14:35
38 lines
11385 bytes
On Thu, Oct 15, 2026, at 15:13, Harald Nordgren via GitGitGadget wrote:
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> "git checkout" records a move of HEAD in the reflog as "checkout:
> moving from <old> to <new>", "git branch -m" records a rename of the
> current branch as "Branch: renamed <old> to <new>", and "git rebase"
> marks where it starts and ends with steps like "rebase (start)" and
> "rebase (finish)". "@{-<n>}" and "git status" read the switch message
> back, each with its own copy of the prefix,

Here it feels like we are thrown into an enumeration without knowing
what for. What is the problem to solve?

> and a later commit adds a
> reader for all of them.

This clause at the end of the six-line sentence seems to reveal why: we
are about to use these strings in more than one place, so we want to
introduce constants in order to not duplicate anything (no drifting
apart). But the why here should have been put at the start. And the
phrasing is also so passive that I had to do a double-take as to what
β€œcommit” meant. A commit in the reflog under discussion? Or a commit
that *we*/*I* are about to make?

The context is that you are about to use these prefixes in more than one
place. And the principle you are following is no duplication. Then the
details follow. If the details of exactly what they say is worth stating
in the commit message.

>
> Name these strings in reflog.h and use them where the messages are
> written and read, so they cannot drift apart.
>
> Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
> ---
>[snip]
Technical Details
Message-ID: <b55b6643-b9a2-4e41-8100-2de545004845@app.fastmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72135-linux-kernel-git=dewy.ru
References: <pull.2448.git.git.1792070038.gitgitgadget@gmail.com> <d95ed5bd679cea41320c39824b969377e8c88e09.1792070038.git.gitgitgadget@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72135-linux-kernel-git=dewy.ru
From: kristofferhaugsbakk@fastmail.com ("Kristoffer Haugsbakk")
Newsgroups: linux.kernel.git
Subject: Re: [PATCH 1/3] reflog: name the strings that mark switches, renames and
 rebase steps
Date: Thu, 15 Oct 2026 16:35:59 +0200
Organization: Usenet Network
Message-ID: <b55b6643-b9a2-4e41-8100-2de545004845@app.fastmail.com>
References: <pull.2448.git.git.1792070038.gitgitgadget@gmail.com>
 <d95ed5bd679cea41320c39824b969377e8c88e09.1792070038.git.gitgitgadget@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2550188"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8UqEcV18o0morlTpbsmVcwV46G0= sha256:gcbDsqLsn2d7fALn0HlOOZcLY5jlg+IEgm/8vLjP+nw=
	sha1:6Bqj69eEMMAqth+CbFaFrn7PbeY= sha256:vqahKU8eUoVnFsDTHsF776zZ5TDSg97NLJZD23r9Tjg=
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 7163F110324; Thu, 15 Oct 2026 17:43:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.148
X-Spam-Status: No, score=-3.148 tagged_above=-9999 required=6.31
	tests=[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.25, 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=fastmail.com header.b=W/BPnlND; dkim=pass (2048-bit key)
	header.d=messagingengine.com header.b=JLlJyTz4
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 HilMm6_SvrrJ;
	Thu, 15 Oct 2026 17:43:41 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=git+bounces-72135-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=fastmail.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 00631110321; Thu, 15 Oct 2026 17:43:27 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
	by sto.lore.kernel.org (Postfix) with ESMTP id 19F5161289E; Thu, 15 Oct 2026 14:39:06 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B12B3793CC;
	Thu, 15 Oct 2026 14:36:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b="W/BPnlND";
	dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JLlJyTz4"
X-Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28CB637DAA9
	for <git@vger.kernel.org>; Thu, 15 Oct 2026 14:36:24 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
	t=1792074989; cv=none; b=kJadne1WusddlWJWbYLFA236Y5tSbczFVZf22v4UrZwT8KbN16hW9+pnPjNzYvDWqqzgCvSAon9Y6WGwu0lVj8DOtQVyzglaQgDVHiO5eeKNvR3tdEUg/ialsi4h7UpruWK59gq1ok5lhvgrT4+lljgbfy66X6pYOAqM4DB2T9w=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1792074989; c=relaxed/simple;
	bh=t/0q6uYOt2N3PILdE1rdbbUOHpWHRwDhVBgP6ixO/gc=;
	h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References:
	 Subject:Content-Type; b=T9XrlWS9EF0Qjn9+6vcxFVV07hneNQzWByW3AyQ1BuR6Jwg/KYq15a0uqfxPuf4owrmtbAMHjj8RgJ+fIOD86YjddUzPI7xGV2PH6Ag/GirJQY685Al5kNwB6Uorf73TFqPtg+KlKnrtB0BXNodXBcNHMjySAJ078Nqoe1x4NJo=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com; spf=pass smtp.mailfrom=fastmail.com; dkim=pass (2048-bit key) header.d=fastmail.com header.i=@fastmail.com header.b=W/BPnlND; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JLlJyTz4; arc=none smtp.client-ip=202.12.124.155
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=fastmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fastmail.com
X-Received: from ams-compute-01.internal (ams-compute-01.internal [10.64.2.61])
	by mailfhigh.stl.internal (Postfix) with ESMTP id 0707D7A01AA
	for <git@vger.kernel.org>; Thu, 15 Oct 2026 10:36:23 -0400 (EDT)
X-Received: from ams-imap-15 ([10.64.2.35])
  by ams-compute-01.internal (MEProxy); Thu, 15 Oct 2026 10:36:24 -0400
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h=
	cc:cc:content-transfer-encoding:content-type:content-type:date
	:date:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to; s=fm2; t=1792074981;
	 x=1792161381; bh=t/0q6uYOt2N3PILdE1rdbbUOHpWHRwDhVBgP6ixO/gc=; b=
	W/BPnlNDP1RgV2IPUZj8j6mA0//PYwclUXACzUrI95fRlS7rAW5XboY6AeJuaiG2
	oiN4sD6pzUKdvsqz5TP5jKcS6W6SitgYXLCuUCl1tLgslqsfoy03brb8t/UpmA81
	kfQHoSkbj9RVOtxDAuKSbYcxTUQWZ5KgqVHhr00c67gB3WVYaETGo4cvpde7q5vQ
	yUp5fGYIalLE/iE3UuYi0uiaVLgx8HZVaXMYcpu16nyk5Q6mJwWT5eumJooAwGmz
	QwsVqlMUCqCx23dDbjygMMFBaVYaLu/7/xmq5TcUrPpzU/wl7Ha/GnFwpT7khdf+
	fpadR6cr4RBX42hK7p/xJQ==
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=cc:cc:content-transfer-encoding
	:content-type:content-type:date:date:feedback-id:feedback-id
	:from:from:in-reply-to:in-reply-to:message-id:mime-version
	:references:reply-to:subject:subject:to:to:x-me-proxy
	:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1792074981; x=
	1792161381; bh=t/0q6uYOt2N3PILdE1rdbbUOHpWHRwDhVBgP6ixO/gc=; b=J
	LlJyTz4SNonlySNJ4/ZdX8d3MAoTZ0u+Vq5N7i3UBP1husrCo3emCLJSBeYwiiDP
	5d35RfYVwzs1lUU6ODZyFugqXZ1duUNUsy5JadVkU9YYh/CI7+83lVPFFpOnIAXa
	YS5wGocn2qCajxKW8TTmub1mTaKyWA6fV8TdgNLHQdXzNNhHWifNUEMKxm3TLXAc
	PgRrkNf5WhJQsjLxt13s7yNOR+DiBUkzCLSF5CzuWRDLUNmeeKJX0tTiCV5XPX+G
	SwwGeRZfmnEYPGvQYszzUTqfheejiqpxHAVTTQpr/38orb2l5337d9eq9nQpE8/g
	ITEvPqY0DYcxRQA2KEW5g==
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=sign d=fastmail.com a=rsa-sha256;
X-DKIM2-Signature: i=1; m=1; t=1792074981; d=fastmail.com;
	mf=PGtyaXN0b2ZmZXJoYXVnc2Jha2tAZmFzdG1haWwuY29tPg==;
	rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+;
	s=fm2:rsa-sha256:vkYtQpXbO4whZzHwjWz/n84UYk3rGObdhKdt4HwcsxSd28k
	nV16vMKvnWTH4XULidfQJckAelbai5r6YW7U6GikhIB9RQgeajdDi9qIK3JYQOnZ
	WRwtXTd9P5RCQj0zM0WWP0x980elCVNlBcNkAuKS5WGVpji/jnxvc/qhlVM8EDmR
	5I4RjMJsGnBckO4phCYtVFj4h/PFFjyamJoLOtTeWdo2IWiJKoHLLPr73Nlg4/Zn
	SsuuEPD09HSEF0VSAotTCHuStaR+AWyo2p7XwuHxHVRfp3wAE9RAupd1TJP7j5IE
	DpL8ySxdJPb3d+uyJip71HBvLnvAtCDDXBRYpnw==;
X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-06;
	repo=github.com/dkim2wg/interop; date=2026-10-04; sw=lmtpprox;
	action=mi-m=1; hc=12;
	hn=cc,content-transfer-encoding,content-type,date,feedback-id,
	from,in-reply-to,message-id,mime-version,references,subject,to;
X-Message-Instance: m=1; h=sha256:useG6E4rjEOwtKugVurtTxVH4XOev1cW64xHd7U5m2c=:t/0q6uYOt2N3PILdE1rdbbUOHpWHRwDhVBgP6ixO/gc=;
X-ME-Sender: <xms:4-TQara0vDxeHCMr3CVvK3nktM_Cjf6ikwVyMb05O2u8ecRhXQKOQNs>
    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hMKb3m0axo6b1QvfNdeNcnH6Gg>
    <xmx:5eTQamWti1e024c6r-uIp_G_VpoFe5OBCDKBcKlNCOCW7Cu0l-W9yZPD>
X-Feedback-ID: i8b11424c:Fastmail
X-Received: by mailuser.ams.internal (Postfix, from userid 501)
	id CDBAA22C00A1; Thu, 15 Oct 2026 10:36:19 -0400 (EDT)
X-Mailer: MessagingEngine.com Webmail Interface
X-Precedence: bulk
X-Mailing-List: git@vger.kernel.org
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-ThreadId: Acg_JYlhWR3s
X-Cc: "Harald Nordgren" <haraldnordgren@gmail.com>
X-In-Reply-To:  <d95ed5bd679cea41320c39824b969377e8c88e09.1792070038.git.gitgitgadget@gmail.com>