Re: [PATCH 1/3] reflog: name the strings that mark switches, renames and rebase steps
- From
- Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
- Date
- Oct 15, 2026, 14:35 UTC
- Message-ID
- <b55b6643-b9a2-4e41-8100-2de545004845@app.fastmail.com>
- In-Reply-To
- <d95ed5bd679cea41320c39824b969377e8c88e09.1792070038.git.gitgitgadget@gmail.com>
On Thu, Oct 15, 2026, at 15:13, Harald Nordgren via GitGitGadget wrote:
Show 8 quoted lines
> 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.
Show 7 quoted lines
> > 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]