From: Junio C Hamano <gitster@pobox•com>
To: Stefan Beller <sbeller@google•com>
Cc: "Daniel Hahler" <git@thequod•de>,
"git@vger•kernel.org" <git@vger•kernel.org>,
"René Scharfe" <l.s.r@web•de>, "Jeff King" <peff@peff•net>
Subject: Re: [PATCH] xdiff: trim common tail with -U0 after diff
Date: Fri, 23 Jun 2017 12:44:24 -0700 [thread overview]
Message-ID: <xmqqefuaebfr.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kZb+ziJGx6GvSVwX85Szce0zT=2gaF1GpPtz8ft1uhdPw@mail.gmail.com> (Stefan Beller's message of "Fri, 23 Jun 2017 12:37:05 -0700")
Stefan Beller <sbeller@google•com> writes:
> So I tried finding out more about this hack,
> and found the patch that introduced the common tail trimming at
> https://public-inbox.org/git/7vmysez0oa.fsf@gitster.siamese.dyndns.org/
> 913b45f51b (xdi_diff: trim common trailing lines, 2007-12-13)
A relevant one that makes me hesitate to take this kind of change is
this:
https://public-inbox.org/git/alpine.LFD.0.9999.0712202009290.21557@woody.linux-foundation.org/#t
that resulted in this change:
commit d2f82950a9226ae1102a7a97f03440a4bf8c6c09
Author: Linus Torvalds <torvalds@linux-foundation•org>
Date: Thu Dec 20 20:22:46 2007 -0800
Re(-re)*fix trim_common_tail()
The tar-ball and the git archive itself is fine, but yes, the diff from
2.6.23 to 2.6.24-rc6 is bad. It's the "trim_common_tail()" optimization
that has caused way too much pain.
Very interesting breakage. The patch was actually "correct" in a (rather
limited) technical sense, but the context at the end was missing because
while the trim_common_tail() code made sure to keep enough common context
to allow a valid diff to be generated, the diff machinery itself could
decide that it could generate the diff differently than the "obvious"
solution.
Thee sad fact is that the git optimization (which is very important for
"git blame", which needs no context), is only really valid for that one
case where we really don't need any context.
next prev parent reply other threads:[~2017-06-23 19:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 10:36 [PATCH] xdiff: trim common tail with -U0 after diff Daniel Hahler
2017-06-23 19:13 ` Junio C Hamano
2017-06-23 19:37 ` Stefan Beller
2017-06-23 19:44 ` Junio C Hamano [this message]
2017-06-23 20:39 ` René Scharfe
2017-06-23 22:57 ` Daniel Hahler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqefuaebfr.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@thequod$(echo .)de \
--cc=git@vger$(echo .)kernel.org \
--cc=l.s.r@web$(echo .)de \
--cc=peff@peff$(echo .)net \
--cc=sbeller@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox