From: Kristoffer Haugsbakk Date: Thu, 15 Oct 2026 14:35:59 GMT Subject: Re: [PATCH 1/3] reflog: name the strings that mark switches, renames and rebase steps Message-ID: In-Reply-To: On Thu, Oct 15, 2026, at 15:13, Harald Nordgren via GitGitGadget wrote: > From: Harald Nordgren > > "git checkout" records a move of HEAD in the reflog as "checkout: > moving from to ", "git branch -m" records a rename of the > current branch as "Branch: renamed to ", and "git rebase" > marks where it starts and ends with steps like "rebase (start)" and > "rebase (finish)". "@{-}" 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 > --- >[snip]