Re: [RFC PATCH, WAS: "weird diff output?" 0/2] implement better chunk heuristics
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 15, 2016, 17:27 UTC
- Message-ID
- <xmqq1t66dbp8.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <CAGZ79kZs33sJj+DPSS4FPoJTLqbCLpvSe_h9UUQM-dBe=8ExKw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 5 quoted lines
> Actually we would only need to have the empty line count in the > second loop as the first loop shifted it as much up(backwards) as > possible, such that the hunk sits on one end of the movable > range. The second loop would iterate over the whole range, so that > would be the only place needed to count.
The description makes me wonder if we can do without two loops ;-)
That is, can we teach the first loop not to be so aggressive to shift "as much as possible" but notice there is an empty line we would want to treat specially?