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

Re: [RFC PATCH, WAS: "weird diff output?" 2/2] xdiff: implement empty line chunk heuristic

From
Jacob Keller <jacob.keller@gmail.com>
Date
Apr 15, 2016, 20:17 UTC
Message-ID
<CA+P7+xoWbrSaONH5xq=w5W190Jknk0Qsc5brS4UKFAs2_dTceg@mail.gmail.com>
In-Reply-To
<xmqq8u0ebpru.fsf@gitster.mtv.corp.google.com>
On Fri, Apr 15, 2016 at 1:06 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 27 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>>> +diff.emptyLineHeuristic::
>>
>> I was looking at the TODO here and thought about the name:
>> It should not encode the `emptyLine` into the config option as
>> it is only one of many heuristics.
>>
>> It should be something like `diff.heuristic=lastEmptyLine`
>> The we could add firstEmptyLine, aggressiveUp, aggressiveDown,
>> breakAtShortestLineLength or other styles as well later on.
>>
>> I do not quite understand the difference between diff.algorithm
>> and the newly proposed heuristic as the heuristic is part of
>> the algorithm? So I guess we'd need to have some documentation
>> saying how these differ. (fundamental algorithm vs last minute
>> style fixup?)
>
> I actually do not think these knobs should exist when the code is
> mature enough to be shipped to the end users.
>
> Use "diff.compactionHeuristics = <uint>" as an opaque set of bits to
> help the developers while they compare notes and reach consensus on
> a single tweak that they can agree on being good enough, and then
> remove that variable before the code hits 'next'.
>
> Thanks.

I was under the impression that we would want a longer lived configuration until we had enough data to say whether it was helpful to make it default. I guess i had thought it would need to be longer lived since there may be cases where it's not optimal and being able to turn it off would be good?

I'd rather keep it semi-human readable vs a uint since it would help keep me sane when looking at it in the interim.

Thanks, Jake

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 22 in “implement better chunk heuristics”
  1. 0/2 implement better chunk heuristicsJacob Keller, Apr 15, 2016
  2. 1/2 xdiff: add xdl_hash_and_recmatch helper functionJacob Keller, Apr 15, 2016
  3. Junio C HamanoApr 15, 2016
  4. Jacob KellerApr 15, 2016
  5. 2/2 xdiff: implement empty line chunk heuristicJacob Keller, Apr 15, 2016
  6. Stefan BellerApr 15, 2016
  7. Junio C HamanoApr 15, 2016
  8. Jacob KellerApr 15, 2016
  9. Junio C HamanoApr 15, 2016
  10. Jacob KellerApr 15, 2016
  11. Jacob KellerApr 15, 2016
  12. Junio C HamanoApr 15, 2016
  13. Jacob KellerApr 15, 2016
  14. Jacob KellerApr 15, 2016
  15. Stefan BellerApr 15, 2016
  16. Stefan BellerApr 15, 2016
  17. Junio C HamanoApr 15, 2016
  18. Stefan BellerApr 15, 2016
  19. Junio C HamanoApr 15, 2016
  20. Jacob KellerApr 15, 2016
  21. Jacob KellerApr 15, 2016
  22. Jacob KellerApr 15, 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.