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

Re: [PATCH 2/2] xdiff: implement empty line chunk heuristic

From
Stefan Beller <sbeller@google.com>
Date
Apr 19, 2016, 07:05 UTC
Message-ID
<CAGZ79kaJxgMCUSp3dVJt4=nPVi=p_HFY+OATh1wXthdKKGpmjA@mail.gmail.com>
In-Reply-To
<20160419070001.GA21875@sigill.intra.peff.net>
On Tue, Apr 19, 2016 at 12:00 AM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> On Mon, Apr 18, 2016 at 11:47:52PM -0700, Stefan Beller wrote:
>
>> I am convinced the better way to do it is like this:
>>
>>     Calculate the entropy for each line and take the last line with the
>>     lowest entropy as the last line of the hunk.
>
> I'll be curious to see the results, but I think sometimes predictable
> and stupid may be the best route with these sorts of things. In
> particular, I'd worry that a content-independent measure of entropy
> might miss some subtleties of a particular language (e.g., that "*" is
> more or less meaningful than some other character). But we'll see. :)

I would assume that the "*" would have little entropy when there are lots of comments, i.e. it just "feels" like an empty line. If there are no "*", then the entropy is high as it is unusual. And unusual things should not be at the border of a hunk I would assume. So m prediction is that the 'subtleties of a particular language' correlate highly with the actual use of characters.

Anyway, the experiment can be carried out later. :)

Thanks, Stefan

Show 6 quoted lines
>
> -Peff
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: Jeff KingNext: Stefan Beller
Message 9 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.