Subject: Re: [BUG?] Major performance issue with some commands on our repo's master branch

From: Junio C Hamano <[email-masked]>
Date: Thu, 09 Jun 2022 11:23:58 -0700

Jeff King <[email-masked]> writes:

>   git show --diff-filter=D -s a6434bc6f7a1
>
> Without the patch above, it always shows the commit. With it, it shows
> nothing. That's a bit far-fetched, but it is a regression, and I'm also
> not sure if it's just the tip of the iceberg.

Here "-s" is merely "do not give patch output like we do by
default", so the behaviour is quite understandable and is not a
regression we would want to see happen.  -S/-G are also likely to be
affected, not just the --diff-filter.

> It also doesn't solve problem completely. Regular commits can have
> expensive diffs, too.

That's a good point.

> I think you'd do better to have a mode specific to git-show that skips
> the diff if we're not showing it, but makes sure to always show the
> commit anyway.

Meaning an explicit option "git show --log-only"?  We'd need to
careful to make it either (1) be incompatible with certain features
of "git show" (like giving a pathspec) and error out, or (2) ignore
these features of "git show" silently and document that.  But it
would work as a new option.

Thanks.