Re: [PATCH 1/2] diff: do not display hunk context under -W
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 16, 2021, 01:37 UTC
- Message-ID
- <xmqq35xwu71w.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqq7dn8u7dz.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 7 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes: > >> But if we viewed it with the -W option we'd show "is_empty_rec()", >> because we'd first find the "xdl_emit_diff()" context line, extend the >> diff to that, and then would go look for context to show again. > > Makes sense.
Ehh, I did not mean "the current behaviour with -W that shows is_empty_rec makes sense". The observation you made (which lead to the conclusion in your next paragraph that it is not a good idea to show is_empty_rec on the hunk header line) made sense to me.
But I do not think any change from the current behaviour should be made if -U<n> wins -W (i.e. the first precontext line shown in the hunk header is not due to -W). We should hunt for the name of the function whose latter half we are seeing at the beginning of the hunk in that case.
Thanks.