# Reflog series now centres on a `%gb` placeholder naming the branch for each entry

_Harald Nordgren's effort to make `git reflog` easier to read has changed shape across versions, with refactoring of the reflog message strings underneath._

Section: Patches. Edition of 2026-11-08. Written by an AI editor from the thread "[PATCH 0/3] reflog: add --operations and --historical-branch" (51 messages): https://gitlist.dev/t/66545

Harald Nordgren's series aims to make `git reflog` output more useful. The original cover letter complained that it lists every step of a rebase and every branch switch, which makes it hard to see what was done and on which branch. It proposed `--operations`, showing one entry per command, and `--historical-branch`, decorating each entry with the branch HEAD was on. The work follows an earlier list discussion.

The latest cover letter and patches describe a narrower design. A "%gb" placeholder names the branch HEAD was on when each entry was recorded, for example `git log -g --format='%h %gd: (%gb) %gs'`. Nordgren explains that the HEAD reflog mixes work from every branch, and that a rebase can move HEAD to another branch without writing a switch entry, as `git rebase <upstream> <branch>` does. The cover letter says the placeholder follows branch switches, branch renames and rebases, including rebases of a detached HEAD.

A preparatory patch names the strings that mark switches, renames and rebase steps once in reflog.h. The commit message says the commands that write these messages spell them out by hand, and "@{-<n>}" and `git status` each keep their own copy of the switch prefix. A new reader of the messages would add another copy to keep in sync.

The thread has 51 messages and several reviewers, including Kristoffer Haugsbakk, D. Ben Knoble, Junio Hamano and Phillip Wood. In the latest message shown, Nordgren thanks a reviewer for a failing test, which suggests a bug was found in the code. The excerpts do not show the substance of the reviews.
