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

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.
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “xdiff: trim common tail with -U0 after diff”
  1. xdiff: trim common tail with -U0 after diffDaniel Hahler, Jun 23, 2017
  2. Junio C HamanoJun 23, 2017
  3. Stefan BellerJun 23, 2017
  4. Junio C HamanoJun 23, 2017
  5. René ScharfeJun 23, 2017
  6. Daniel HahlerJun 23, 2017

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.