Re: What's cooking in git.git (Feb 2017, #03; Fri, 10)
- From
René Scharfe <l.s.r@web.de>
- Date
- Feb 10, 2017, 23:05 UTC
- Message-ID
- <77af28f3-7a8e-fc6a-40ae-c4203d1a3a67@web.de>
- In-Reply-To
- <xmqq37flk7l4.fsf@gitster.mtv.corp.google.com>
Am 10.02.2017 um 23:24 schrieb Junio C Hamano:
Show 10 quoted lines
> * vn/xdiff-func-context (2017-01-15) 1 commit > - xdiff -W: relax end-of-file function detection > > "git diff -W" has been taught to handle the case where a new > function is added at the end of the file better. > > Will hold. > Discussion on an follow-up change to go back from the line that > matches the funcline to show comments before the function > definition has not resulted in an actionable conclusion.
This one is a bug fix and can be merged already IMHO.
I have raw patches for showing comments before functions with -W, but they don't handle the case of a change being within such a comment. We'd want to show the trailing function which it is referring to in such a case, right?
And that's a bit tricky because it requires a more complicated model: Currently we distinguish only between function lines and the rest, while the new way would require identifying leading comment lines and probably also trailing function body lines in addition to that, and neither can be classified simply by looking at the line in question -- their type depends on that of neighboring lines.
René