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

Re: git merge commits are non-deterministic? what changed?

From
Andreas Schwab <schwab@linux-m68k.org>
Date
Nov 9, 2012, 15:04 UTC
Message-ID
<m2y5iarf5s.fsf@igel.home>
In-Reply-To
<20121109133132.GK69724@acme.spoerlein.net>
Ulrich Spörlein <uqs@spoerlein.net> writes:
> Two questions:
> 1. Can we impose a stable ordering of the commits being recorded in a
> merge commit? Listing parents in chronological order or something like
> that.

The order is determined by the order the refs are given to git merge (or git commit-tree when using the plumbing).

> 2. Why the hell is the commit hash dependent on the ordering of the
> parent commits? IMHO it should sort the set of parents before
> calculating the hash ...
What would be the sort key?
Andreas.
-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Previous: Ulrich SpörleinNext: Ulrich Spörlein
Message 2 of 9 in “git merge commits are non-deterministic? what changed?”
  1. Ulrich SpörleinNov 9, 2012
  2. Andreas SchwabNov 9, 2012
  3. Ulrich SpörleinNov 9, 2012
  4. Matthieu MoyNov 9, 2012
  5. Jeff KingNov 9, 2012
  6. Ulrich SpörleinNov 9, 2012
  7. Michael J GruberNov 12, 2012
  8. Ulrich SpörleinNov 20, 2012
  9. Junio C HamanoNov 20, 2012

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.