From: Michael J Gruber <git@drmicha.warpmail.net>
To: "Ulrich Spörlein" <uqs@spoerlein.net>
Cc: Jeff King <peff@peff.net>,
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>,
Andreas Schwab <schwab@linux-m68k.org>,
git@vger.kernel.org
Subject: Re: git merge commits are non-deterministic? what changed?
Date: Mon, 12 Nov 2012 12:27:31 +0100 [thread overview]
Message-ID: <50A0DD23.4040800@drmicha.warpmail.net> (raw)
In-Reply-To: <20121109182753.GQ69724@acme.spoerlein.net>
Ulrich Spörlein venit, vidit, dixit 09.11.2012 19:27:
> On Fri, 2012-11-09 at 11:16:47 -0500, Jeff King wrote:
>> On Fri, Nov 09, 2012 at 04:52:48PM +0100, Matthieu Moy wrote:
>>
>>> Ulrich Spörlein <uqs@spoerlein.net> writes:
>>>
>>>>>> 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?
>>>>
>>>> Trivially, the hash of the parents itself. So you'd always get
>>>>
>>>> ...
>>>> parent 0000
>>>> parent 1111
>>>> parent aaaa
>>>> parent ffff
>>>
>>> That would change the behavior of --first-parent. Or you'd need to
>>> compute the sha1 of the sorted list, but keep the unsorted one in the
>>> commit. Possible, but weird ;-).
>>
>> Right. The reason that merge parents are stored in the order given on
>> the command line is not random or because it was not considered. It
>> encodes a valuable piece of information: did the user merge "foo" into
>> "bar", or did they merge "bar" into "foo"?
>>
>> So I think this discussion is going in the wrong direction; git should
>> never sort the parents, because the order is meaningful. The original
>> complaint was that a run of svn2git produced different results on two
>> different git versions. The important question to me is: did svn2git
>> feed the parents to git in the same order?
>>
>> If it did, and git produced different results, then that is a serious
>> bug.
>>
>> If it did not, then the issue needs to be resolved in svn2git (which
>> _may_ want to sort the parents that it feeds to git, but it would depend
>> on whether the order it is currently presenting is meaningful).
>
> Yeah, thanks, looks like I have some more work to do. I don't quite get
> how it could come up with a different order, seeing that it is using svn
> as the base.
>
> Will run some more experiments, thanks for the info so far.
There was a change in the order in which "git cherry-pick A B C" applies
the commits. It's the only odering affecting change in 1.8.0 that I can
think of right now.
Michael
next prev parent reply other threads:[~2012-11-12 11:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 13:31 git merge commits are non-deterministic? what changed? Ulrich Spörlein
2012-11-09 15:04 ` Andreas Schwab
2012-11-09 15:42 ` Ulrich Spörlein
2012-11-09 15:52 ` Matthieu Moy
2012-11-09 16:16 ` Jeff King
2012-11-09 18:27 ` Ulrich Spörlein
2012-11-12 11:27 ` Michael J Gruber [this message]
2012-11-20 16:22 ` Ulrich Spörlein
2012-11-20 20:39 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50A0DD23.4040800@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=Matthieu.Moy@grenoble-inp.fr \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=schwab@linux-m68k.org \
--cc=uqs@spoerlein.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.