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

log --graph --first-parent weirdness

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Jun 4, 2008, 15:00 UTC
Message-ID
<20080604150042.GA3038@mithlond.arda.local>

The output of "git log --graph --first-parent" seems weird. Maybe it's because I don't understand everything but here's an example anyway:

$ git log --graph --pretty=oneline --abbrev-commit --decorate
M   2ba1dba... (refs/heads/master) Merge branch 'topic'
|\  
| * 432e062... (refs/heads/topic) Change from branch 'topic'
* | b762236... Change from branch 'master'
|/  
* d7fb80a... Initial commit
Normal --first-parent prints this:
$ git log --first-parent --pretty=oneline --abbrev-commit

2ba1dba... Merge branch 'topic' b762236... Change from branch 'master' d7fb80a... Initial commit

With --graph it goes:
$ git log --graph --first-parent --pretty=oneline --abbrev-commit
M   2ba1dba... Merge branch 'topic'
|\  
* | b762236... Change from branch 'master'
* | d7fb80a... Initial commit
 /

So, it prints the second parent line but it leads to nowhere. Try the same with the git repository and you'll see a _lots_ of parallel branch lines which seem to go nowhere.

Next: Teemu Likonen
Message 1 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.