git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Any objectsions to enhancing git-log to show tags/branch heads?

From
Junio C Hamano <junkio@cox.net>
Date
Apr 16, 2007, 17:46 UTC
Message-ID
<7vy7kstdom.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<E1HdQah-0008Q2-7E@candygram.thunk.org>
"Theodore Ts'o" <tytso@mit.edu> writes:
Show 13 quoted lines
> 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
Previous: Theodore Ts'oNext: Theodore Tso
Message 2 of 15 in “Any objectsions to enhancing git-log to show tags/branch heads?”
  1. Theodore Ts'oApr 16, 2007
  2. Junio C HamanoApr 16, 2007
  3. Theodore TsoApr 16, 2007
  4. Peter BaumannApr 16, 2007
  5. J. Bruce FieldsApr 16, 2007
  6. Peter BaumannApr 17, 2007
  7. J. Bruce FieldsApr 17, 2007
  8. Julian PhillipsApr 16, 2007
  9. Peter BaumannApr 17, 2007
  10. Linus TorvaldsApr 16, 2007
  11. Theodore TsoApr 17, 2007
  12. Jakub NarebskiApr 17, 2007
  13. Linus TorvaldsApr 17, 2007
  14. Junio C HamanoApr 23, 2007
  15. Theodore TsoApr 17, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.