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

Re: v2.11 new diff heuristic?

From
Stefan Beller <sbeller@google.com>
Date
Nov 22, 2016, 17:51 UTC
Message-ID
<CAGZ79kbJ1vM=wd+53RezKEuucBCG96rL7dNhZpqR6m+brRAJ=w@mail.gmail.com>
In-Reply-To
<CAHd499AjXh1YnVgBj_8j0fgvOgOn53y+sPBBy6y7mSM-+dCyVw@mail.gmail.com>
On Tue, Nov 22, 2016 at 6:42 AM, Robert Dailey <rcdailey.lists@gmail.com> wrote:
Show 15 quoted lines
> The release notes mention a new heuristic for diff:
>
> * Output from "git diff" can be made easier to read by selecting
> which lines are common and which lines are added/deleted
> intelligently when the lines before and after the changed section
> are the same. A command line option is added to help with the
> experiment to find a good heuristics.
>
> However, it lacks information on exactly how to use this new feature.
> 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?
yes.
> Is the
> compaction heuristic compatible with the histogram diff algorithm?
yes as the compaction heuristic is applied after the actual diff is performed.
> 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?
I think you can set diff.compactionHeuristic and it will use it by default.
>
> There's still so much more about this feature I would like to know.

The background story (and what this new compaction heuristic is doing) is found at https://github.com/mhagger/diff-slider-tools

Previous: Jacob KellerNext: Jeff King
Message 3 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.