git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] xdiff: unignore changes in function context

From
Jeff King <peff@peff.net>
Date
Dec 5, 2019, 21:09 UTC
Message-ID
<20191205210945.GA49397@coredump.intra.peff.net>
In-Reply-To
<xmqq5ziu1y0l.fsf@gitster-ct.c.googlers.com>
On Thu, Dec 05, 2019 at 09:29:46AM -0800, Junio C Hamano wrote:
Show 7 quoted lines
> > -# Note that the "6" in the expected hunk header below is funny, since we only
> > -# show 5 lines (the missing one was blank and thus ignored). This is how
> > -# --ignore-blank-lines behaves even without --function-context, and this test
> > -# is just checking the interaction of the two features. Don't take it as an
> > -# endorsement of that output.
> 
> Nice to see that somebody anticipated that we may fix this some day.

Or that somebody just didn't want to be embarrassed by introducing such obvious nonsense into the test suite. :)

I was curious, though, whether there was still a lurking bug in "--ignore-blank-lines", based on what that comment says. But I don't think so. It reports the correct numbers for this test case, but that's because the blank line drops off the context. If we add -U4, then it does mention 6 lines in the preimage, and includes the line.

Which matches what René claimed in the commit message: "Changes involving only blank lines are hidden with --ignore-blank-lines, unless they appear in the context lines of other changes." But now I've double-checked. :)

(And I agree that the output after this patch is way better).
-Peff
Previous: Junio C Hamano
Message 3 of 3 in “xdiff: unignore changes in function context”
  1. xdiff: unignore changes in function contextRené Scharfe, Dec 5, 2019
  2. Junio C HamanoDec 5, 2019
  3. Jeff KingDec 5, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.