Re: [PATCH] revision: quit pruning diff more quickly when possible
- From
Jeff King <peff@peff.net>
- Date
- Oct 13, 2017, 15:44 UTC
- Message-ID
- <20171013154401.hwwvl2xi5quv2sg3@sigill.intra.peff.net>
- In-Reply-To
- <e2db8086-29af-a8bc-1e12-8642e430fcb3@gmail.com>
On Fri, Oct 13, 2017 at 11:37:50AM -0400, Derrick Stolee wrote:
Show 6 quoted lines
> Thanks, Peff. This patch looks good to me. > > I tried a few other things like adding a flag DIFF_OPT_HAS_ANY_CHANGE next > to DIFF_OPT_HAS_CHANGES that we could check in diff_can_quit_early() but it > had side-effects that broke existing tests. From this exploration, it does > seem necessary to be aware of 'remove_empty_trees'.
Keep in mind that the regular diff_change callbacks already handle this case[1].
The file_change callbacks are specific to the revision machinery's pruning diff, and intentionally hold back the HAS_CHANGES flag.
-Peff
[1] I tried "git diff-tree --root -r --quiet 45546f17e" on the bomb
repo, and it went quickly. Dropping --quiet makes it take a really
long time.