Subject: Re: suboptimal behavior of fast-import in some cases with "from"

From: Junio C Hamano <[email-masked]>
Date: Mon, 06 Jul 2015 15:54:35 -0700

Mike Hommey <[email-masked]> writes:

> One of the first things parse_from does is unconditionally throw away
> the tree for the given branch, and then the "from" tree is loaded. So
> when the "from" commit is the current head of the branch, that make
> fast-import do more work than necessary.

If it is very common that the next commit the input stream wants to
create is often on top of the commit that was just created, and if
it is very common that the input stream producer knows what the
commit object name of the commit that was just created, then
optimising for that case does not sound too bad.  It really depends
on two factors:

 - How likely is it that other people make the same mistake?

 - How bad the damage to parse_from() would be if we wanted to
   optimize for this case?