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

Re: [PATCH] The diff-raw format updates.

From
Junio C Hamano <junkio@cox.net>
Date
May 22, 2005, 19:35 UTC
Message-ID
<7vy8a7cavf.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v64xbdq4y.fsf@assigned-by-dhcp.cox.net>
>>>>> "JCH" == Junio C Hamano <junkio@cox.net> writes:
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> The machine readable format has the same issue: it needs to be able to LT> distinguish between a "copy" (where the source remains) and a "rename" LT> (where the source is removed).

JCH> Why? If the same path appears later as the left hand side then JCH> it is a copy otherwise it is a rename. Please see what JCH> diffcore-rename does when assigning to dp->xfrm_msg.

JCH> What I've been trying hard so far was to keep diff_filepair not JCH> to be too specific to rename/copy. What I do not like about JCH> what is being proposed is that it would force me to introduce JCH> this "is this a copy or a rename" flag to that structure.

Linus, another way of saying the above is this.

Think about the example in test that munge COPYING file. What was recorded in the two trees as the result of

    sed $munge_1 <COPYING >COPYING.1
    sed $munge_2 <COPYING COPYING.2
    rm COPYING

will be expressed as copy-edit of COPYING.1 and rename-edit of COPYING.2 (both from COPYING). But that is just _one_ interpretation diffcore-rename _arbitrarily_ makes.

It could have been copy-edit of COPYING.2 and rename-edit of COPYING.1 (both from COPYING). If you make the change you are proposing to diff-raw format, reordering diff-raw entries stops making sense, while the current format allows us to.

It is similar to your argument of not _recording_ renames on commit but _tracking_ it upon inspection. I deliberatly chose not to record rename/copy distinction in diff-raw --- it is to be inferred from which entry touches the src _last_. Everything but the last one to touch the same path is copy, and the last one is rename.

Previous: Junio C HamanoNext: Linus Torvalds
Message 19 of 33 in “updated design for the diff-raw format.”
  1. Junio C HamanoMay 21, 2005
  2. Junio C HamanoMay 21, 2005
  3. Junio C HamanoMay 21, 2005
  4. Junio C HamanoMay 21, 2005
  5. Junio C HamanoMay 21, 2005
  6. Prepare diffcore interface for diff-tree header supression.Junio C Hamano, May 22, 2005
  7. The diff-raw format updates.Junio C Hamano, May 22, 2005
  8. Linus TorvaldsMay 22, 2005
  9. Junio C HamanoMay 22, 2005
  10. Junio C HamanoMay 22, 2005
  11. Fix tweak in similarity estimator.Junio C Hamano, May 22, 2005
  12. Linus TorvaldsMay 22, 2005
  13. Niklas HoglundMay 22, 2005
  14. Junio C HamanoMay 22, 2005
  15. Thomas GlanzmannMay 22, 2005
  16. Linus TorvaldsMay 22, 2005
  17. Thomas GlanzmannMay 22, 2005
  18. Junio C HamanoMay 22, 2005
  19. Junio C HamanoMay 22, 2005
  20. Linus TorvaldsMay 22, 2005
  21. Junio C HamanoMay 22, 2005
  22. Linus TorvaldsMay 22, 2005
  23. Junio C HamanoMay 23, 2005
  24. Linus TorvaldsMay 23, 2005
  25. Junio C HamanoMay 23, 2005
  26. Rename/copy detection fix.Junio C Hamano, May 23, 2005
  27. Comments on "Rename/copy detection fix."Junio C Hamano, May 23, 2005
  28. Junio C HamanoMay 22, 2005
  29. Diffcore updates.Junio C Hamano, May 22, 2005
  30. Linus TorvaldsMay 22, 2005
  31. Junio C HamanoMay 22, 2005
  32. Diffcore updates.Junio C Hamano, May 22, 2005
  33. Be careful with symlinks when detecting renames and copies.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.