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

Re: [PATCH] diff: prefer indent heuristic over compaction heuristic

From
Stefan Beller <sbeller@google.com>
Date
Apr 27, 2017, 21:17 UTC
Message-ID
<CAGZ79kY2Yu=B+75D6DpNjdriAZnJ5pZSmYAUiYtF2aUK47_HPw@mail.gmail.com>
In-Reply-To
<653b67e6-9dba-d331-c396-932a59cdb4da@alum.mit.edu>

picking up this old topic, with Martin, Marc and SZEDER cc'd, as we got patch proposals regarding the indent heuristic.

On Sat, Dec 24, 2016 at 4:55 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 26 quoted lines
> On 12/23/2016 10:17 PM, Junio C Hamano wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>>
>>> I guess both you and Michael are in favor of just removing compaction
>>> variant without any renames, so let me prepare a reroll and queue
>>> that instead.  We can flip the default perhaps one release later.
>>
>> -- >8 --
>> Subject: [PATCH] diff: retire "compaction" heuristics
>>
>> When a patch inserts a block of lines, whose last lines are the
>> same as the existing lines that appear before the inserted block,
>> "git diff" can choose any place between these existing lines as the
>> boundary between the pre-context and the added lines (adjusting the
>> end of the inserted block as appropriate) to come up with variants
>> of the same patch, and some variants are easier to read than others.
>>
>> We have been trying to improve the choice of this boundary, and Git
>> 2.11 shipped with an experimental "compaction-heuristic".  Since
>> then another attempt to improve the logic further resulted in a new
>> "indent-heuristic" logic.  It is agreed that the latter gives better
>> result overall, and the former outlived its usefulness.
>>
>> Retire "compaction", and keep "indent" as an experimental feature.
>> The latter hopefully will be turned on by default in a future
>> release, but that should be done as a separate step.

Maybe turning on this feature by default is the next step instead of adding them to bash competition or making them available in plumbing commands for the upcoming release.

Then in a later release we could even remove the knobs to turn it off.

Thanks, Stefan

Previous: Michael HaggertyNext: Jeff King
Message 15 of 17 in “diff: prefer indent heuristic over compaction heuristic”
  1. diff: prefer indent heuristic over compaction heuristicJacob Keller, Dec 17, 2016
  2. Junio C HamanoDec 17, 2016
  3. Jacob KellerDec 17, 2016
  4. Junio C HamanoDec 22, 2016
  5. Jacob KellerDec 22, 2016
  6. Junio C HamanoDec 22, 2016
  7. Jeff KingDec 23, 2016
  8. Jacob KellerDec 23, 2016
  9. Jeff KingDec 23, 2016
  10. Junio C HamanoDec 23, 2016
  11. Junio C HamanoDec 23, 2016
  12. Jeff KingDec 23, 2016
  13. Jacob KellerDec 23, 2016
  14. Michael HaggertyDec 24, 2016
  15. Stefan BellerApr 27, 2017
  16. Jeff KingApr 28, 2017
  17. Martin LiškaApr 28, 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.