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

Re: weird diff output?

From
Jacob Keller <jacob.keller@gmail.com>
Date
Mar 30, 2016, 19:14 UTC
Message-ID
<CA+P7+xp+oT2zMBZqR8zvXKm8Zp5btaNyoOWFTts29HMwX+2o=Q@mail.gmail.com>
In-Reply-To
<CA+P7+xqskf6Ti3tVwMrOAaj3EDykRLKiXG5EbbzkjRsZP0s_7w@mail.gmail.com>
On Tue, Mar 29, 2016 at 11:05 PM, Jacob Keller <jacob.keller@gmail.com> wrote:
Show 30 quoted lines
> On Tue, Mar 29, 2016 at 9:55 PM, Jeff King <peff@peff.net> wrote:
>> One thing I like to do when playing with new diff ideas is to pipe all
>> of "log -p" for a real project through it and see what differences it
>> produces.
>>
>
> Great idea!
>
>> Below is a perl script that implements Stefan's heuristic. I checked its
>> output on git.git with:
>>
>>   git log --format='commit %H' -p >old
>>   perl /path/to/script <old >new
>>   diff -F ^commit -u old new | less
>>
>> which shows the differences, with the commit id in the hunk header
>> (which makes it easy to "git show $commit | perl /path/to/script" to
>> see the new diff with more context.
>>
>
> I'll try to run this  against my projects and see what it looks like
> to see if I can spot (m)any counter examples, which would indicate
> it's a bad idea. I may have some time in the next few days to see how
> hard it would be to fully integrate it into the diff machinery too.
>
> Thanks for the help!
>
> Regards,
> Jake
>

I ran this on a few of my local projects and it doesn't seem to produce any false positives so far. Everything looks good. Of course this is with just traditional C code. I am currently trying to run this against the history of Linux as well and see if I can find anything that seems bad there.

Thanks, Jake

Previous: Jacob KellerNext: Jacob Keller
Message 10 of 27 in “weird diff output?”
  1. Jacob KellerMar 29, 2016
  2. Stefan BellerMar 29, 2016
  3. Junio C HamanoMar 29, 2016
  4. Stefan BellerMar 29, 2016
  5. Jacob KellerMar 29, 2016
  6. Junio C HamanoMar 30, 2016
  7. Jeff KingMar 30, 2016
  8. Stefan BellerMar 30, 2016
  9. Jacob KellerMar 30, 2016
  10. Jacob KellerMar 30, 2016
  11. Jacob KellerMar 30, 2016
  12. Stefan BellerMar 30, 2016
  13. Junio C HamanoApr 1, 2016
  14. Jeff KingMar 31, 2016
  15. Jacob KellerApr 6, 2016
  16. Stefan BellerApr 12, 2016
  17. Davide LibenziApr 14, 2016
  18. Jeff KingApr 14, 2016
  19. Stefan BellerApr 14, 2016
  20. Implement better chunk heuristics.Stefan Beller, Apr 15, 2016
  21. Jacob KellerApr 15, 2016
  22. Stefan BellerApr 15, 2016
  23. Jacob KellerApr 15, 2016
  24. Junio C HamanoApr 15, 2016
  25. Stefan BellerApr 15, 2016
  26. Jacob KellerApr 15, 2016
  27. Jeff KingApr 15, 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.