Re: [PATCH] xdiff: trim common tail with -U0 after diff
- From
Stefan Beller <sbeller@google.com>
- Date
- Jun 23, 2017, 19:37 UTC
- Message-ID
- <CAGZ79kZb+ziJGx6GvSVwX85Szce0zT=2gaF1GpPtz8ft1uhdPw@mail.gmail.com>
- In-Reply-To
- <xmqqinjmecuk.fsf@gitster.mtv.corp.google.com>
On Fri, Jun 23, 2017 at 12:13 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 9 quoted lines
> Daniel Hahler <git@thequod.de> writes: > >> When -U0 is used, trim_common_tail should be called after `xdl_diff`, so >> that `--indent-heuristic` (and other diff processing) works as expected. > > I thought common-tail trimming was a hack/optimization to avoid > having to pass the whole thing to have xdl_diff() work on it? What > would we be gaining by unconditionally passing the whole thing first > and then still trimming?
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)
In the early days there were much larger email threads apparently. I haven't seen such a big one in a while. I did not find the email that the commit message referenced to unfortunately.
AFAICT we have 2 things going on: * swapping the order of xdl_diff and the tail trimming * change the condition under which the tail is trimmed (as a logical follow up/ cleanup because of the first point)
I do not understand the first one, yet.