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

Re: [PATCH] diff compaction heuristic: favor shortest neighboring blank lines

From
Stefan Beller <sbeller@google.com>
Date
Jun 17, 2016, 16:09 UTC
Message-ID
<CAGZ79kZgdbqnWW9uqeBHNDbyGVfc0x5gTJbyD0Nyi1i3SNvENQ@mail.gmail.com>
In-Reply-To
<20160617153637.GA9314@sigill.intra.peff.net>
On Fri, Jun 17, 2016 at 8:36 AM, Jeff King <peff@peff.net> wrote:
Show 7 quoted lines
>
> Did you want something that triggers the "bad" case with the existing
> compaction heuristic?
>
> I gave one in:
>
>   http://article.gmane.org/gmane.comp.version-control.git/296947
I found that out after sending the initial patch. Thanks for pointing out!
Show 7 quoted lines
>
> I think the difference is that in my example, the diff (before
> compaction) has the blank line at the top (because we are adding a new
> entry at the bottom), whereas in yours, the blank line is at the bottom.
>
> This patch does make my "bad" case look better. Unfortunately, it
> re-breaks another case:

I think before spending more time on discussing and implementing new (hopefully better) heuristics, I'd want to step back and try to be a bit more systematic, i.e. I'll want to collect lots of test cases in different languages and use cases. A mini test suite, maybe?

I think I'll include these examples in there, too.

Thanks, Stefan

Previous: Jeff KingNext: Michael Haggerty
Message 7 of 15 in “diff compaction heuristic: favor shortest neighboring blank lines”
  1. diff compaction heuristic: favor shortest neighboring blank linesStefan Beller, Jun 16, 2016
  2. Junio C HamanoJun 16, 2016
  3. Stefan BellerJun 16, 2016
  4. Michael HaggertyJun 16, 2016
  5. Stefan BellerJun 16, 2016
  6. Jeff KingJun 17, 2016
  7. Stefan BellerJun 17, 2016
  8. Michael HaggertyJun 23, 2016
  9. Stefan BellerJun 23, 2016
  10. Junio C HamanoJun 23, 2016
  11. Michael HaggertyJun 23, 2016
  12. Michael HaggertyJun 30, 2016
  13. diff heuristics dramatically improved by considering line indentation and blank linesMichael Haggerty, Jul 1, 2016
  14. Junio C HamanoJul 1, 2016
  15. Jakub NarębskiJul 4, 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.