git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "René Scharfe" <l.s.r@web.de>,
	"Git Mailing List" <git@vger.kernel.org>, 刘炜 <lw17qhdz@gmail.com>
Subject: Re: [PATCH] xdiff: unignore changes in function context
Date: Thu, 5 Dec 2019 16:09:45 -0500	[thread overview]
Message-ID: <20191205210945.GA49397@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqq5ziu1y0l.fsf@gitster-ct.c.googlers.com>

On Thu, Dec 05, 2019 at 09:29:46AM -0800, Junio C Hamano wrote:

> > -# 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

      reply	other threads:[~2019-12-05 21:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 16:15 [PATCH] xdiff: unignore changes in function context René Scharfe
2019-12-05 17:29 ` Junio C Hamano
2019-12-05 21:09   ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191205210945.GA49397@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=l.s.r@web.de \
    --cc=lw17qhdz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).