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

Re: v2.11 new diff heuristic?

From
Jeff King <peff@peff.net>
Date
Nov 22, 2016, 17:55 UTC
Message-ID
<20161122175550.mlxzt3kgw3hj52qh@sigill.intra.peff.net>
In-Reply-To
<CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com>
On Tue, Nov 22, 2016 at 08:42:36AM -0600, Robert Dailey wrote:
Show 6 quoted lines
> I dug into the git diff documentation here:
> 
> https://git-scm.com/docs/git-diff
> 
> It mentions a "--compaction-heuristic" option. Is this the new
> heuristic outlined by the release notes? If not, which is it?

No. The docs on git-scm.com are only for released versions, so that is the "old" attempt at a similar feature from v2.9. The "new" one goes by the name "--indent-heuristic" (and "diff.indentHeuristic" in the config). It is not the default in v2.11, but it probably will become so in a future version.

Show 7 quoted lines
> Is the
> compaction heuristic compatible with the histogram diff algorithm? Is
> there a config option to turn this on all the time? For that matter,
> is this something I can keep on all the time or is it only useful in
> certain situations?
> 
> There's still so much more about this feature I would like to know.

Yes, you can keep it all the time. Yes, it's compatible with histogram (and patience); it happens as a separate post-processing step after the actual diff.

You can find more discussion about how it works in the commit message of 433860f3d0beb0c6f205290bd16cda413148f098.

-Peff
Previous: Stefan Beller
Message 4 of 4 in “v2.11 new diff heuristic?”
  1. Robert DaileyNov 22, 2016
  2. Jacob KellerNov 22, 2016
  3. Stefan BellerNov 22, 2016
  4. Jeff KingNov 22, 2016

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.