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

Now I think I am done with diff...

From
Junio C Hamano <junkio@cox.net>
Date
May 23, 2005, 06:50 UTC
Message-ID
<7vmzqm77wl.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7v4qcwihu1.fsf@assigned-by-dhcp.cox.net>
>>>>> "I" == Junio C Hamano <junkio@cox.net> said:
JCH> Now I think I am done with diff,...

I think I have fixed the diff-raw output routine enough to address the rename and copy distinction issues (although I chose not to give individual entries "this is a copy" or "this is a rename" indicators).

And I thought I was really done with diff this time, but here are some leftover issues I would like to further address, not necessarily in this order, and not necessarily promising to do all of them.

 - Make "diff-raw human readable" output quite different from
   "diff-raw machine readable" format.  I think human readable
   format should be more like "concise version of diff-patch
   format for human consumption", not the current "LF and TAB
   separated version of machine readable output", to enhance
   readability.  This includes:
   (1) not repeating paths when src and dst are the same
       (i.e. most of the time);
   (2) substituting src/dst with /dev/null when talking about
       creation or deletion;
   (3) prefixing the src and dst with '+' or '*' or '-'.
   Currently I do not intend to add _parsing_ of such output to
   diff-helper because you can always use -z on both ends of the
   pipe (and as yourself said "Sure. Although I doubt people use
   the raw diff output except to (a) feed to diff-helper or (b)
   check that it's non-empty."), but I have to sleep on this.
 - Add an option to cause diff-tree three-brothers not to call
   diffcore_prune() at all.  This will essentially produce
   something like a merge of two output from ls-files or
   ls-trees commands, but with renames/copies resolved.  I do
   not know how useful this would be, especially now the
   immediate problem of diff_flush() pruning all the
   "non-change" entries is (hopefully) fixed.
 - Give pickaxe an option to cause it to produce diffs for the
   entire commit, not just the found file.
 - Experiment with the patch reordering I talked about in the
   previous message.
 - Add the support of "copied from post-edit image" detection in
   rename/copy logic.  Currently I compare only with pre-edit
   image for modified files.
 - Read and understand the patch-delta.c, to make rename/copy
   similarity estimator more accurate.  As you pointed out, it
   does very bad things on big consecutive deletes.
 - Think about performance issues around "diff-tree -C" stuff.
 - Think more about the problem with the patch output between
   two symbolic links, and how to fix it (I've been quietly
   thinking about this for some time ;-)).  I think the current
   output of just comparing the two readlink results and
   generating a normal diff between them is broken and hazardous
   if such a thing is mistakenly fed to patch -p1.
 - Teach JIT about the diff-raw format changes.
Previous: Junio C Hamano
Message 43 of 43 in “Detect renames in diff family.”
  1. Detect renames in diff family.Junio C Hamano, May 19, 2005
  2. Linus TorvaldsMay 19, 2005
  3. Junio C HamanoMay 19, 2005
  4. Linus TorvaldsMay 19, 2005
  5. Nicolas PitreMay 19, 2005
  6. Junio C HamanoMay 19, 2005
  7. Nicolas PitreMay 19, 2005
  8. Junio C HamanoMay 19, 2005
  9. Nicolas PitreMay 19, 2005
  10. Junio C HamanoMay 19, 2005
  11. Linus TorvaldsMay 19, 2005
  12. Junio C HamanoMay 19, 2005
  13. Linus TorvaldsMay 20, 2005
  14. Junio C HamanoMay 20, 2005
  15. Junio C HamanoMay 19, 2005
  16. Junio C HamanoMay 19, 2005
  17. Linus TorvaldsMay 19, 2005
  18. Junio C HamanoMay 19, 2005
  19. H. Peter AnvinMay 19, 2005
  20. Joel BeckerMay 19, 2005
  21. Junio C HamanoMay 21, 2005
  22. 1/3 Diff overhaul, adding half of copy detection.Junio C Hamano, May 21, 2005
  23. 2/3 Introducing software archaeologist's tool "pickaxe".Junio C Hamano, May 21, 2005
  24. Constness fix for pickaxe option.Junio C Hamano, May 21, 2005
  25. Linus TorvaldsMay 21, 2005
  26. 3/3 Diff overhaul, adding the other half of copy detection.Junio C Hamano, May 21, 2005
  27. Teach diff-tree to report unmodified paths for -C option.Junio C Hamano, May 21, 2005
  28. Junio C HamanoMay 21, 2005
  29. Linus TorvaldsMay 21, 2005
  30. Junio C HamanoMay 21, 2005
  31. Linus TorvaldsMay 21, 2005
  32. Linus TorvaldsMay 21, 2005
  33. Linus TorvaldsMay 21, 2005
  34. Junio C HamanoMay 21, 2005
  35. Junio C HamanoMay 24, 2005
  36. Linus TorvaldsMay 24, 2005
  37. Junio C HamanoMay 24, 2005
  38. Linus TorvaldsMay 24, 2005
  39. Junio C HamanoMay 24, 2005
  40. Detect copies harder in diff-tree.Junio C Hamano, May 26, 2005
  41. Junio C HamanoMay 21, 2005
  42. Tweak diffcore-rename heuristics.Junio C Hamano, May 21, 2005
  43. Now I think I am done with diff...Junio C Hamano, May 23, 2005

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.