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

Re: [PATCH 0/3] reflog: add --operations and --historical-branch

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Oct 16, 2026, 18:36 UTC
Message-ID
<CALnO6CDOh1NCp4Y9euLbhVFJJnOc1jSk7q0ekdUeGniG8LTCGQ@mail.gmail.com>
In-Reply-To
<pull.2448.git.git.1792070038.gitgitgadget@gmail.com>

[Apologies for replying in the wrong chain; it appears I haven't received 3/3 yet and it's easier for me to reply to a message I have than one I can only see in lore.]

On Thu, Oct 15, 2026 at 9:20 AM Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com> wrote:

>   reflog: add --historical-branch to name the branch of each entry
Show 9 quoted lines
> Teach "git reflog" and "git log -g" a "--historical-branch" option
> that decorates each entry with the branch it was made on, in place of
> the refs that point at the commit now. The name is colored like a
> branch decoration:
>
>   $ git reflog --historical-branch
>   4e5f6a7 (topic) HEAD@{0}: commit: add tests
>   1a2b3c4 (topic) HEAD@{1}: checkout: moving from main to topic
>   8c9d0e1 (main) HEAD@{2}: commit: fix typo

Notice how the "HEAD@" column is now not aligned? I find it really convient to have fixed-width data at the front of the line so that I can visually pick out pieces in columns.

So I'd suggest an alternat end-of-line format:
    $ git reflog --historical-branch
    4e5f6a7 HEAD@{0}: commit: add tests (topic)
    1a2b3c4 HEAD@{1}: checkout: moving from main to topic (topic)
    8c9d0e1 HEAD@{2}: commit: fix typo (main)

That might make picking out the branch name a little harder, so I suppose you could try right before the messages?

    $ git reflog --historical-branch
    4e5f6a7 HEAD@{0}: (topic) commit: add tests
    1a2b3c4 HEAD@{1}: (topic) checkout: moving from main to topic
    8c9d0e1 HEAD@{2}: (main) commit: fix typo
or (since the "operation" prefixes" are useful)
    $ git reflog --historical-branch
    4e5f6a7 HEAD@{0}: commit: (topic) add tests
    1a2b3c4 HEAD@{1}: checkout: (topic) moving from main to topic
    8c9d0e1 HEAD@{2}: commit: (main) fix typo

? Obviously the misalignment in all the examples (except the EOL format) gets worse when you have some short and some long branch names.

Previous: Harald NordgrenNext: Harald Nordgren
Message 13 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.