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:33 UTC
Message-ID
<Pine.LNX.4.58.0506191926530.2268@ppc970.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0506191921270.2268@ppc970.osdl.org>
On Sun, 19 Jun 2005, Linus Torvalds wrote:
> 
> Your commit is a merge. A corrupted one.

Btw, if possibly, you should just undo it. It's "valid" in the sense that having the same parent duplicated will just be considered to be a merge by a paritcularly strange person, but it's definitely not good practice, and since it _is_ technically a merge, programs that avoid showing merges (like "git-whatchanged" - because it doesn't know what it should show as the "difference") won't show it.

Other programs, like "git-diff-tree -m", which show _all_ sides of a merge, will show the diff twice (because it shows the diff against all parents). Which is also why you see it twice in your git-changes-script.

Again, "git commit" _did_ warn about this, I'm sure, but I actually see why that stupid MERGE_HEAD file was there - a null merge won't remove a stale MERGE_HEAD, so it's probably because you did a "git pull" that was a trivial merge, and that would have left that turd around..

		Linus
Previous: Jeff GarzikNext: Jeff Garzik
Message 5 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.