Re: Any objectsions to enhancing git-log to show tags/branch heads?
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:04
"Theodore Ts'o" [off-list ref] writes:
I've recently noticed that I'm often firing up gitk for no other purpose than to see which changesets have which tags and branch heads. Often I'll fire up gitk, quickly look at the tags/branches, and then kill it before it's done parsing the repository, resulting in python errors as it dies. So I'm wondering why we haven't arranged to have git-log show this information, and whether there would be any objections if "git-log" showed something like this: ... The only reason why I could imagine not doing this by default would be a potential performance problem if there were thousands of heads or branch heads.
I cannot comment on performance impact without knowing exactly
what semantics is being proposed.
(1) If a commit is not directly pointed by any ref, would it
get HEAD: or TAG: line, perhaps ala 'git-describe'?
(2) If a commit is at the tip of two branches, what happens?
Would it get two HEAD: lines?
(3) Same question as (2) when a commit is tagged with two tags,
or at the tip of a branch and pointed by a tag.
As to the impact on people's existing scripts that read git-log,
I think changing --pretty=anything would cause breakage for
somebody. A new --pretty=format: tag would be the least
destabilizing, but I dunno.
But the fact that you kill gitk before it stops drawing suggests
that you are interested in recent commits only? What is exactly
the use case? What I am wondering is:
(a) you have a handful specific commit IDs and wondering what
they are, relative to known anchoring points.
If this is the case, git-describe and git-name-rev may be
your friend.
(b) whenever you are browsing random part of history, you often
wonder which ones are tagged or at the tip. Browsing "git
log" output does not give the visual cue of anchoring
points like "gitk" output does, which annoys you.
A code-free way to help with this is:
$ git log | git -p name-rev --stdin