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, 23:01 UTC
Message-ID
<7vis1adfvq.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0505221259110.2307@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> On Sun, 22 May 2005, Junio C Hamano wrote:
Show 5 quoted lines
>> 
>> 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.
LT> My counter-example: there is no rename at all, just a copy.

My wording was wrong. If you do not use the helper, you should be able to get copy and in-place edit or no-modification (I collectively call them "stay" in diffcore-rename.c). If it does not work then you have spotted a bug in the implementation but not the design. Anyway, I should have said:

    Everything but the last are copies.  If the last one have
    different src and dst, then it is a rename.  Otherwise it
    is a "stay".

LT> Try it. I added in the "&& detect_rename < 2" thing to diff-tree.c, and I LT> get:

LT> 	git-whatchanged -C --root | git-diff-helper | less -S
LT> resulting in:

That's not a counter-example. You are agreeing to what I said in this message:

    To: Linus Torvalds <torvalds@osdl.org>
    Cc: git@vger.kernel.org
    Subject: [PATCH] Teach diff-tree to report unmodified paths for -C option.
    Date: Sat, 21 May 2005 03:11:49 -0700
    Message-ID: <7vpsvkj3bu.fsf_-_@assigned-by-dhcp.cox.net>
    ...
    Another useless comment.  For obvious reasons, there is nothing
    we can do about the diff-helper to add "the other half of copy
    detection information", because what it can tell diff-core is
    limited to its input, which usually is just differences prepared
    by somebody else, and it cannot know anything about unchanged
    files.  When I started pushing '-p' flag to diff-tree family, I
    remember that your reaction was neutral to moderately negative
    ("I'd tolerate, although I think it is redundant and you are not
    even generating diff yourself anyway" as opposed to "That's just
    great").  I think now you would thank me for shoving the diff
    interface into them ;-).

If you want the diff-helper to be able to the full scale copy detection, you must _feed_ the full information including "stay" entries to it. Unfortunately, the current diffcore interface does not let the callers (diff-tree family) to tell it to keep the "stay" entries in its output. I've been working on that part this morning before this discussion started, so that electively they can tell the diffcore layer not to do the "stay" pruning ("stay pruning" will simply become another diffcore transformation).

I have to leave again now, but I promise you'll hear back from me on this one later tonight (or tomorrow evening at the latest if things do not work out).

Previous: Linus TorvaldsNext: Linus Torvalds
Message 21 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.