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 23, 2005, 00:35 UTC
Message-ID
<7vu0kubwyg.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0505221611020.2307@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:

LT> You seem to think that it's a feature that you can't get the same output LT> out of git-diff-helper, and I think that's not a feature, but a total bug.

I do agree that it is a real problem.

And I think you've filled some holes in the idea I originally had while working on the following (the part you omitted from the quote):

    ...  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).

The change I am making right now is essentially what the above paragraph says, with your "hole-filling", to do something like this:

 (1) diff-tree family feeds unmodified entries to the diffcore,
     in addition to changes.  diffcore-rename matches and merges
     them into rename/copy; diffcore-pickaxe filters; other
     diffcore transformations may later be written (e.g
     reordering the patch so that .h files come first before .c
     files).  The result of the sequence of these
     transformations is fed to the diff_flush() for output.
     Essentially this is the same architecture as we already
     have.
 (2) diff_flush() currently prunes _all_ the unmodified entries
     just before output happens.  This is a _bug_ as you said.
     To fix this, first, separate that pruning part (which is
     currently embedded in diff_flush_one as the first
     statement) out, so this pruning happens independently and
     before diff_flush() happens; and make the pruning more
     careful, not to prune entries that we _need_ to express
     rename/copy distinction in diff-raw output.  Namely, it
     should keep the unmodified entry for a path _if_ the path
     is to be used as the source of a rename or copy entry.
     Also diff-patch output needs to be taught to take notice
     and ignore such entries.
     Optionally, the callers may want to tell diffcore not to do
     _any_ pruning, making diff-raw output similar to a merge of
     ls-files --stage outputs of two trees.

LT> I'm arguing that we should consider it a _requirement_ that "raw diffs" LT> can be translated into te same thing the "-p" flag internally does.

To this, I 100% agree, and I think it is doable. Give me a bit more time for testing and tweaking.

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