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

Re: [BUG] git-log shows first parent and repeated last for octopus merge

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 18, 2006, 14:02 UTC
Message-ID
<200610181602.36856.jnareb@gmail.com>
In-Reply-To
<Pine.LNX.4.63.0610181551150.14200@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 15 quoted lines
> On Wed, 18 Oct 2006, Jakub Narebski wrote:
> 
> > When trying to find how many merges and how many octopus merges (merges with
> > more than two parents) are in git.git repository I have encountered the
> > following strange output of git-log:
> > 
> >  1000:jnareb@roke:~/git> git log --parents --full-history --max-count=1 \
> >    211232bae64bcc60bbf5d1b5e5b2344c22ed767e -- a//b
> >  commit 211232bae64bcc60bbf5d1b5e5b2344c22ed767e <last parent repeated>
> >  Merge: d0d0d0b... d0d0d0b... d0d0d0b... d0d0d0b... d0d0d0b...
> >  [...]
> 
> This happens because a//b rewrites the history, i.e. the parents are 
> edited. IMHO it makes no sense at all to show the parents in such a case, 
> since they are bogus.

Or rather it has no sense to _repeat_ rewritten parent the number of times the commit has parents originally. Compare git-log and git-rev-list results:

1010:jnareb@roke:~/git> git rev-list --full-history --header --parents \
  --max-count=2 211232bae64bcc60bbf5d1b5e5b2344c22ed767e -- a//b
211232bae64bcc60bbf5d1b5e5b2344c22ed767e d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f
tree cdafa88fa4ed7fcc7bb6c64d62e2d7c4d3b65e42
parent fc54a9c30ccad3fde5890d2c0ca2e2acc0848fbc
parent 9e30dd7c0ecc9f10372f31539d0122db97418353
parent c4b83e618f1df7d8ecc9392fa40e5bebccbe6b5a
parent 660265909fc178581ef327076716dfd3550e6e7b
parent b28858bf65d4fd6d8bb070865518ec43817fe7f3
author Junio C Hamano <junkio@cox.net> 1115335014 -0700
committer Junio C Hamano <junkio@cox.net> 1115335014 -0700
    Octopus merge of the following five patches.
    
      Update git-apply-patch-script for symbolic links.
      Make git-prune-script executable again.
      Do not write out new index if nothing has changed.
      diff-cache shows differences for unmerged paths without --cache.
      Update diff engine for symlinks stored in the cache.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>
d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f 54c26fb9d0cdff94c7717125d0a222b324bfea8a
[...]
1014:jnareb@roke:~/git> PAGER= git log --full-history --parents \
  --max-count=2 211232bae64bcc60bbf5d1b5e5b2344c22ed767e -- a//b
commit 211232bae64bcc60bbf5d1b5e5b2344c22ed767e d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f
Merge: d0d0d0b... d0d0d0b... d0d0d0b... d0d0d0b... d0d0d0b...
Author: Junio C Hamano <junkio@cox.net>
Date:   Thu May 5 16:16:54 2005 -0700
    Octopus merge of the following five patches.
    
      Update git-apply-patch-script for symbolic links.
      Make git-prune-script executable again.
      Do not write out new index if nothing has changed.
      diff-cache shows differences for unmerged paths without --cache.
      Update diff engine for symlinks stored in the cache.
    
    Signed-off-by: Junio C Hamano <junkio@cox.net>

commit d0d0d0bd3c2c4591ffbc292d7e082e8ad8f2057f 54c26fb9d0cdff94c7717125d0a222b324bfea8a 54c26fb9d0cdff94c7717125d0a222b324bfea8a [...]

-- 
Jakub Narebski
Poland
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 of 6 in “[BUG] git-log shows first parent and repeated last for octopus merge”
  1. Jakub NarebskiOct 18, 2006
  2. Johannes SchindelinOct 18, 2006
  3. Jakub NarebskiOct 18, 2006
  4. When rewriting parents, cull duplicatesJohannes Schindelin, Oct 18, 2006
  5. Junio C HamanoOct 18, 2006
  6. A Large Angry SCMOct 18, 2006

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.