Re: [PATCH v2 0/3] reflog: add --operations and --historical-branch
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Oct 24, 2026, 19:12 UTC
- Message-ID
- <CAHwyqnX5sbmL_2tJ59KoBzMiTiz5OVzJXuwV+hUxU_b3YrXo-g@mail.gmail.com>
- In-Reply-To
- <bfc2b43a-6198-47b0-8868-d92551548f22@gmail.com>
Show 9 quoted lines
> > * --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.
Show 11 quoted lines
> If we're going to do this we should make sure it supports "git rebase
> <upstream> <branch>" 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