From: Harald Nordgren Date: Sat, 24 Oct 2026 19:12:45 GMT Subject: Re: [PATCH v2 0/3] reflog: add --operations and --historical-branch Message-ID: In-Reply-To: > > * --historical-branch decorates each entry with the branch HEAD was on when > > it was recorded. > > I quite like this idea, but think it would be nicer implemented as a > format specifier ("%gb" seems to be free) so that users can use it in > their custom formats. I'd be quite happy to change the default format do > for HEAD to include the branch name after the reflog message but I'm not > sure others would be so keen (perhaps we could get away with guarding > any change by isatty()/GIT_PAGER_IN_USE?). Seems like an interesting plan to do `%gb`, instead. It radically changes this series and drops `--operations` altogether then. > If we're going to do this we should make sure it supports "git rebase > " so that the branch names are accurate. That is a > bit involved because you have to compare the name of the branch being > rebased (which is in the "(finish)" reflog message) to the name of the > branch that was checked out before (which isn't in that message so you > have to go looking for a previous rebase or checkout). It also needs to > take account of rebases that checkout a detached HEAD which don't have > the "(finish)" message and those that checkout an up-to-date branch or > detached HEAD where the message is "$GIT_REFLOG_ACTION: checkout > $revision". I've got a patch [1] that fixes this for "@{-N}" which I > think works, but it needs some more tests. Nice, looking forward to it. Harald