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

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.
Previous: Junio C HamanoNext: Stefan Beller
Message 19 of 20 in “xdiff: implement empty line chunk heuristic”
  1. 0/2 xdiff: implement empty line chunk heuristicStefan Beller, Apr 18, 2016
  2. 1/2 xdiff: add recs_match helper functionStefan Beller, Apr 18, 2016
  3. 2/2 xdiff: implement empty line chunk heuristicStefan Beller, Apr 18, 2016
  4. Jacob KellerApr 18, 2016
  5. Junio C HamanoApr 18, 2016
  6. Jeff KingApr 19, 2016
  7. Stefan BellerApr 19, 2016
  8. Jeff KingApr 19, 2016
  9. Stefan BellerApr 19, 2016
  10. Stefan BellerApr 19, 2016
  11. Jeff KingApr 19, 2016
  12. Jacob KellerApr 19, 2016
  13. Junio C HamanoApr 19, 2016
  14. Michael S. TsirkinApr 20, 2016
  15. Junio C HamanoApr 20, 2016
  16. Jeff KingApr 20, 2016
  17. Junio C HamanoApr 20, 2016
  18. Junio C HamanoApr 19, 2016
  19. Junio C HamanoApr 18, 2016
  20. Stefan BellerApr 18, 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.