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

Re: log --graph --first-parent weirdness

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 5, 2008, 18:31 UTC
Message-ID
<7vbq2f3f9t.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080605095033.GC5946@mithlond.arda.local>
Teemu Likonen <tlikonen@iki.fi> writes:
> Well, I disagree :-) Merges are interesting points in history (they
> introduce features etc.) and for a "--graph --first-parent" user
> a certain already known merge is easier to find if there is a stable
> identifier for them.

Step back a bit. Regular commits also introduce features. If you want to argue for marking a merge as more significant than single parent commits, you need to justify the reason why a bit better.

When you are looking at a history (be it 'first-parent' or regular), each transition introduces changes, but especially when you are talking about first-parent, a merge is merely a squashed commit of everything that happened on the side branch, which may be trivial one-liner fix or an addition of full new command. Why a merge of trivial one-liner fix should be treated as more significant than a more involved change that directly was done on the master branch?

A full and perfect implementation of a new command may have happened on a side branch as a single commit. If the master branch was dormant while it was being done, the final merge of that side branch will result in a fast-forward, and the introduction of the new command would appear as a non-merge, regular commit. If on the other hand there were activities on master since the side branch forked, the introduction of the new command would appear as a merge. Why do you paint the latter as more significant than the former?

If somebody argues for making the marking different (perhaps by color-code the asterisk differently) depending on how much each commit changes the tree relative to its parents, I would say it might be a great feature. Such a display would treat the two cases I mentioned above equally.

I however do not think the number of recorded parents deserves such a special treatment to clutter the output and distract people, especially when "is it a merge?" can be easily seen by two other means (log message and graph lines).

Previous: Teemu Likonen
Message 11 of 11 in “log --graph --first-parent weirdness”
  1. Teemu LikonenJun 4, 2008
  2. Teemu LikonenJun 4, 2008
  3. Junio C HamanoJun 4, 2008
  4. Teemu LikonenJun 4, 2008
  5. Adam SimpkinsJun 4, 2008
  6. graph API: fix "git log --graph --first-parent"Adam Simpkins, Jun 5, 2008
  7. Junio C HamanoJun 4, 2008
  8. Ping YinJun 5, 2008
  9. Adam SimpkinsJun 5, 2008
  10. Teemu LikonenJun 5, 2008
  11. Junio C HamanoJun 5, 2008

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.