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

Re: 'git commit' duplicates parents?

From
Linus Torvalds <torvalds@osdl.org>
Date
Jun 20, 2005, 02:24 UTC
Message-ID
<Pine.LNX.4.58.0506191921270.2268@ppc970.osdl.org>
In-Reply-To
<42B59CF7.3080509@pobox.com>
On Sun, 19 Jun 2005, Jeff Garzik wrote:
Show 7 quoted lines
> 
> I just checked in a change with 'git commit' (no arguments).  Two 
> strange things occurred:
> 
> 1) git-whatchanged does not list the change at all.  However,
> 	a) I verified that my change is indeed top-of-tree
> 	b) git-changes-script (attached) does show the change
Your commit is a merge. A corrupted one.
Show 10 quoted lines
> 2) git-changes-script shows the parents in a readable fashion, and it 
> shows two duplicate parent entries.  In contrast, other changes do not 
> have two parents:
> 
> my change:
> > commit 4864989199fa62c7044be2258550ddc561411ab6
> 		^^^ top of tree aka .git/HEAD
> > tree b40996c7a0a5446875aa3664045af7e377451bf6
> > parent 7df551254add79a445d2e47e8f849cef8fee6e38
> > parent 7df551254add79a445d2e47e8f849cef8fee6e38
Notice: two times the same head.

You had a MERGE_HEAD in your tree, and "git commit" warned you about it in big bold letters and told you what to do, but you ignored it.

"git commit" said:
                echo "#"
                echo "# It looks like your may be committing a MERGE."
                echo "# If this is not correct, please remove the file"
                echo "# $GIT_DIR/MERGE_HEAD"
                echo "# and try again"
                echo "#"
and if you had just done as it asked you, you'd have been ok.

As to why you had a .git/MERGE_HEAD in your tree, it's probably because your merge scripts haven't kept up with mine.

		Linus
Previous: Jeff GarzikNext: Jeff Garzik
Message 3 of 12 in “'git commit' duplicates parents?”
  1. Jeff GarzikJun 19, 2005
  2. Jeff GarzikJun 19, 2005
  3. Linus TorvaldsJun 20, 2005
  4. Jeff GarzikJun 20, 2005
  5. Linus TorvaldsJun 20, 2005
  6. Jeff GarzikJun 20, 2005
  7. Linus TorvaldsJun 20, 2005
  8. Dan HolmsandJun 20, 2005
  9. Linus TorvaldsJun 20, 2005
  10. Dan HolmsandJun 20, 2005
  11. Linus TorvaldsJun 20, 2005
  12. Dan HolmsandJun 20, 2005

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.