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

Re: "git diff" surprising default output

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 1, 2023, 19:40 UTC
Message-ID
<xmqqzg8wmfa6.fsf@gitster.g>
In-Reply-To
<871qm849co.fsf@osv.gnss.ru>
Sergey Organov <sorganov@gmail.com> writes:
Show 8 quoted lines
> I figured the offender is --indent-heuristic that is described in the
> manual as:
>
>       Enable the heuristic that shifts diff hunk boundaries to make
>       patches easier to read. This is the default.
>
> but apparently rather makes patches harder to read, at least at some
> conditions. Turning it off helps to get the expected result:

As a heuristic, it is not surprising that it has some corner cases where it does not shine. I think the version that was eventually merged starts here

  https://lore.kernel.org/git/cover.1473068229.git.mhagger@alum.mit.edu/

and we should be able to find a few links to the original observation that motivated the change, e.g.

  https://public-inbox.org/git/cover.1470259583.git.mhagger@alum.mit.edu/
Thanks.
Previous: Sergey OrganovNext: Sergey Organov
Message 2 of 3 in “"git diff" surprising default output”
  1. Sergey OrganovMar 1, 2023
  2. Junio C HamanoMar 1, 2023
  3. Sergey OrganovMar 1, 2023

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.