git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
KHKristoffer 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]
Previous: Harald Nordgren via GitGitGadgetNext: Harald Nordgren
Message 3 of 51 in “reflog: add --operations and --historical-branch”
  1. 0/3 reflog: add --operations and --historical-branchHarald Nordgren via GitGitGadget, Oct 15, 2026
  2. 1/3 reflog: name the strings that mark switches, renames and rebase stepsHarald Nordgren via GitGitGadget, Oct 15, 2026
  3. Kristoffer HaugsbakkOct 15, 2026
  4. Harald NordgrenOct 15, 2026
  5. 2/3 reflog: add --operations to show one entry per commandHarald Nordgren via GitGitGadget, Oct 15, 2026
  6. 3/3 reflog: add --historical-branch to name the branch of each entryHarald Nordgren via GitGitGadget, Oct 15, 2026
  7. Kristoffer HaugsbakkOct 15, 2026
  8. Harald NordgrenOct 15, 2026
  9. Kristoffer HaugsbakkOct 15, 2026
  10. Harald NordgrenOct 15, 2026
  11. D. Ben KnobleOct 16, 2026
  12. Harald NordgrenOct 23, 2026
  13. D. Ben KnobleOct 16, 2026
  14. Harald NordgrenOct 17, 2026
  15. 0/3 reflog: add --operations and --historical-branchHarald Nordgren via GitGitGadget, Oct 18, 2026
  16. 1/3 reflog: name the strings that mark switches, renames and rebase stepsHarald Nordgren via GitGitGadget, Oct 18, 2026
  17. Junio C HamanoOct 23, 2026
  18. Harald NordgrenOct 23, 2026
  19. Junio C HamanoOct 23, 2026
  20. 2/3 reflog: add --operations to show one entry per commandHarald Nordgren via GitGitGadget, Oct 18, 2026
  21. 3/3 reflog: add --historical-branch to name the branch of each entryHarald Nordgren via GitGitGadget, Oct 18, 2026
  22. Kristoffer HaugsbakkOct 25, 2026
  23. Harald NordgrenOct 25, 2026
  24. Kristoffer HaugsbakkOct 26, 2026
  25. Harald NordgrenOct 26, 2026
  26. Harald NordgrenOct 23, 2026
  27. Phillip WoodOct 24, 2026
  28. D. Ben KnobleOct 24, 2026
  29. Junio C HamanoOct 24, 2026
  30. Harald NordgrenOct 24, 2026
  31. Kristoffer HaugsbakkOct 25, 2026
  32. Phillip WoodOct 26, 2026
  33. Harald NordgrenOct 26, 2026
  34. Junio C HamanoOct 26, 2026
  35. Ben KnobleOct 27, 2026
  36. Junio C HamanoOct 27, 2026
  37. Harald NordgrenOct 27, 2026
  38. Ben KnobleOct 27, 2026
  39. Harald NordgrenOct 24, 2026
  40. 0/2 reflog: add --operations and --historical-branchHarald Nordgren via GitGitGadget, Oct 27, 2026
  41. 1/2 reflog: name the strings that mark switches, renames and rebase stepsHarald Nordgren via GitGitGadget, Oct 27, 2026
  42. 2/2 pretty: add %gb to name the branch of each reflog entryHarald Nordgren via GitGitGadget, Oct 27, 2026
  43. Phillip WoodNov 3, 2026
  44. 0/2 reflog: add format %gbHarald Nordgren via GitGitGadget, Nov 4, 2026
  45. 1/2 reflog: name the strings that mark switches, renames and rebase stepsHarald Nordgren via GitGitGadget, Nov 4, 2026
  46. 2/2 pretty: add %gb to name the branch of each reflog entryHarald Nordgren via GitGitGadget, Nov 4, 2026
  47. Phillip WoodNov 6, 2026
  48. Harald NordgrenNov 7, 2026
  49. 0/2 reflog: add format %gbHarald Nordgren via GitGitGadget, Nov 7, 2026
  50. 1/2 reflog: name the strings that mark switches, renames and rebase stepsHarald Nordgren via GitGitGadget, Nov 7, 2026
  51. 2/2 pretty: add %gb to name the branch of each reflog entryHarald Nordgren via GitGitGadget, Nov 7, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.