From: Junio C Hamano Date: Wed, 06 Apr 2016 19:18:33 GMT Subject: Re: [PATCH] merge: refuse to create too cool a merge by default Message-ID: In-Reply-To: Linus Torvalds 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.