From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: Gabriel Holodak <gthepiper@gmail.com>, git <git@vger.kernel.org>
Subject: Re: Possible bug: identical lines added/removed in git diff
Date: Thu, 30 Aug 2018 15:20:19 -0400 [thread overview]
Message-ID: <20180830192019.GB19685@sigill.intra.peff.net> (raw)
In-Reply-To: <CAGZ79kZNVw4-q9KYAi9G3axb7-Ggpc2EAK8ZxAZoPEnZvEL-DQ@mail.gmail.com>
On Thu, Aug 30, 2018 at 12:16:22PM -0700, Stefan Beller wrote:
> On Wed, Aug 29, 2018 at 7:54 PM Jeff King <peff@peff.net> wrote:
> >
> > On Wed, Aug 29, 2018 at 10:10:25PM -0400, Gabriel Holodak wrote:
> >
> > > > Could you cut down to a real minimal reproduction, i.e. just these 20
> > > > lines or so?
> > >
> > > I'm working on getting down to a minimal reproduction, a few lines at
> > > a time. One thing that seems strange: as I've removed lines, there are
> > > a bunch of lines that don't matter. Then I'll find some lines that, if
> > > removed, completely fix the issue. But the ordering for these
> > > apparently important lines doesn't matter. They just have to be
> > > somewhere in the file to cause the duplicated diffs.
> > >
> > > I'll upload again when I've figured out all the unimportant lines to remove.
> >
> > Yeah, I reproduced based on your initial post, but noticed that when I
> > cut it down the problem went away.
>
> Oh, I had to look further down than I did initially. Now I can reproduce it
> from the initial data as well.
>
> Note that it goes away with --minimal.
That's interesting. I did wonder if this was in fact a bug, or simply
that Myers does not promise to find the absolute minimal diff. I'm
_still_ not sure, especially because the minimization is so obvious in
this case (literally the first "-" and the first "+" line of a
contiguous hunk are identical).
> I have a patch cooking (which was sent out as
> https://public-inbox.org/git/20180810221857.87399-1-sbeller@google.com/)
>
> and one of the weaknesses in that patch is the lack of explanation on
> when the heuristic is applied as I have not fully understood it yet.
I'm not sure I understand it either. But at least knowing that --minimal
changes the output gives a lead for investigation (I don't really have
time to dig into it in the next few days, though).
-Peff
next prev parent reply other threads:[~2018-08-30 19:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 1:54 Possible bug: identical lines added/removed in git diff Gabriel Holodak
2018-08-27 17:47 ` Stefan Beller
2018-08-30 2:10 ` Gabriel Holodak
2018-08-30 2:54 ` Jeff King
2018-08-30 19:16 ` Stefan Beller
2018-08-30 19:20 ` Jeff King [this message]
2018-08-30 19:28 ` Stefan Beller
2018-08-31 21:38 ` Johannes Schindelin
2018-09-01 15:23 ` Stefan Beller
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=20180830192019.GB19685@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gthepiper@gmail.com \
--cc=sbeller@google.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).