Re: [RFC PATCH, WAS: "weird diff output?" 2/2] xdiff: implement empty line chunk heuristic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 15, 2016, 20:06 UTC
- Message-ID
- <xmqq8u0ebpru.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79ka7h25=rHun_hPv1qjqeghXt1UwUU3Q6xT0aj4+OW87fg@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 15 quoted lines
>> +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.