Repository navigation
reflog: show the current branch by default - #2469
Draft
HaraldNordgren wants to merge 5 commits into
Draft
HaraldNordgren wants to merge 5 commits into
HaraldNordgren wants to merge 5 commits into
Conversation
|
There is an issue in commit 14ccf1b:
|
|
There is an issue in commit aec1797:
|
"git reflog @{0}" shows the reflog of the current branch, but spells
out its full refname on every line:
47374e9 refs/heads/topic@{0}: commit: three
3cf990e refs/heads/topic@{1}: branch: Created from HEAD
"git reflog topic" and "git reflog @{-1}" label the same entries
"topic@{0}" and so on. Do the same for @{0}. When the short name is
ambiguous, enough of the refname is kept to tell it apart, e.g.
"heads/topic@{0}" when there is also a tag "topic".
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
"git reflog" shows the HEAD reflog, which mixes the history of every
branch that was checked out with each branch switch and every step of
a rebase. To find an earlier state of the branch you are on, its own
reflog is easier to read, with one entry per change to it, e.g. a
single "rebase (finish)" entry for a whole rebase.
Show the reflog of the current branch when no ref is given, the same
as "git reflog @{0}". When HEAD is detached, this is the HEAD reflog,
and "git reflog HEAD" shows the HEAD reflog in any case.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
HaraldNordgren
force-pushed
the
reflog-current-branch
branch
from
October 27, 2026 19:24
aec1797 to
bfce471
Compare
After a rebase, the reflogs spell out the full refname of the rebased
branch:
topic@{0}: rebase (finish): refs/heads/topic onto <commit>
HEAD@{0}: rebase (finish): returning to refs/heads/topic
Other reflog entries use short names, e.g. "checkout: moving from
main to topic" and "branch: Created from upstream/master". Write the
short branch name in the "finish" and "abort" entries too.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Renaming or copying a branch spells out both full refnames in the
reflog:
HEAD@{0}: Branch: renamed refs/heads/old to refs/heads/new
Write the short branch names, the same as the other reflog entries
about branches, e.g. "checkout: moving from main to topic".
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Reflog entries written by older versions of Git spell out the full
refnames of branches:
topic@{3}: rebase (finish): refs/heads/topic onto <commit>
Newer entries name them by their short names. Strip "refs/heads/"
from the messages when showing them, so that old and new entries
read the same.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Contributor
|
Please mention in the commit message that it works quite nicely also with |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make "git reflog" show the reflog of the current branch by default, the same as "git reflog @{0}", and label those entries with the short branch name, e.g. "topic@{0}". With a detached HEAD it still shows the HEAD reflog.