Re: [PATCH] diff: teach --stat to ignore uninteresting modifications
- From
Matt Rogers <mattr94@gmail.com>
- Date
- Aug 2, 2020, 01:51 UTC
- Message-ID
- <CAOjrSZtbEJ5-tnU497r8jE2PYWhKR1Qu14SZRnqceRnLMSheiQ@mail.gmail.com>
- In-Reply-To
- <xmqqv9i128iq.fsf@gitster.c.googlers.com>
Show 16 quoted lines
> > For example, if we further change mode bits of file 'x' (which has a > whitespace-only changes applied in the test in the previous hunk), > e.g. > > git update-index --chmod=+x x && > git diff --stat -b --cached >actual > > should that be counted as a file with 0-line change that is worth > reporting, or is it hidden? I _think_ the new code will do a wrong > thing here. That is, > > - If the change truly is only mode bits and one and two have > "same_contents", the new code is bypassed, and we'll continue to > show "0 lines changed, but the file is worth reporting". >
This first one is the behavior I was going for, I think it's most reasonable
> - If the change is whitespace-only change plus mode bits, i.e. one > and two do not have "same_contents", the new code triggers and > the stat output is suppressed for the path. >
I just ran some tests on my end, and you're correct here, I'll try to come up with a reroll that addresses this and adds this as a test condition.
-- Matthew Rogers