Re: [PATCH] merge: refuse to create too cool a merge by default
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 6, 2016, 19:18 UTC
- Message-ID
- <xmqqshyywnp2.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CA+55aFy-mb00=KGWghx5XXfkv5dChnncoLoJA07f_2Y_or0FOw@mail.gmail.com>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> ... And I guess it might not be too nasty > to add: it could be done as part of the object checking pass after > downloading the pack. Was that what you were thinking of?
Not that fancy, actually. Running an equivalent of
git rev-list --max-parents=0 ^HEAD FETCH_HEAD
was what I had in mind. This shouldn't be too costly for a normal case (O(N) where N is the number of changes on FETCH_HEAD since it forked from you).
It needs to be done even when FETCH_HEAD is a descendant of HEAD, (i.e. when we would have fast forwarded without creating a merge) to be effective, as --no-allow-new-root is about not trusting your subsystem people not doing silly things on purpose, unlike our original patches.