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
Theodore Tso <tytso@mit.edu>
Date
Apr 16, 2007, 20:46 UTC
Message-ID
<20070416204659.GI27533@thunk.org>
In-Reply-To
<7vy7kstdom.fsf@assigned-by-dhcp.cox.net>
On Mon, Apr 16, 2007 at 10:46:33AM -0700, Junio C Hamano wrote:
Show 5 quoted lines
> 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'?
No.
>  (2) If a commit is at the tip of two branches, what happens?
>      Would it get two HEAD: lines?
Yup, I was assuming it would get two Head: lines, one for each head.
>  (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.

Two tag: lines, one for each tag. Mercurial's "hg log" does this today, by the way, and I've found it to be very handy since it makes it easier to find various tagged releases when browsing the revision history.

> 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.

When I write my shell scripts and parse "Foo: " headers I always explicitly grep out the headers I want, and assumin a blank line after the headers, because I expect that future versions might add new headers, and I want my code to be robust; but I can imagine there might be some less-than-robust scripts out there....

> 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?

Well, usually what I'm interested in is near the tip, but not always. In general, seeing the anchor points is part of the problem, and so "git log | git -p name-rev --stdin" is useful, although it isn't as useful as "gitk" when a revision has multiple HEAD or TAG's associated with it, and git-name-rev doesn't know which one(s) would be of greatest interest.

						- Ted
Previous: Junio C HamanoNext: Peter Baumann
Message 3 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.