Re: [PATCH 0/2 v4] xdiff: implement empty line chunk heuristic
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 18, 2016, 21:22 UTC
- Message-ID
- <xmqqbn564noq.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <1461013950-12503-1-git-send-email-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 11 quoted lines
>> OK, so perhaps either of you two can do a final version people can
>> start having fun with?
>
> Here we go. I squashed in your patch, although with a minor change:
>
> - if ((flags & XDF_SHORTEST_LINE_HEURISTIC)) {
> + if ((flags & XDF_COMPACTION_HEURISTIC) && blank_lines) {
>
> We did not need that in the "shortest line" heuristic as we know
> a line with the shortest line length must exist. We do not know about
> empty lines though.Makes sense. The last hunk of
$ git show 9614b8dcf -- update-cache.c
gives an unexpected result without "&& blank_lines" above. Lack of "&& blank_lines" happens to make the result slightly easier to read, but at the cost of having an extra line in the hunk.
Thanks.