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

Re: [PATCH] Resurrect diff-tree-helper -R

From
Junio C Hamano <junkio@cox.net>
Date
May 1, 2005, 02:22 UTC
Message-ID
<7vis231y7y.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.58.0504301805300.2296@ppc970.osdl.org>
>>>>> "LT" == Linus Torvalds <torvalds@osdl.org> writes:
LT> Talking about the diffs, I'm beginning to hate those "mode" things.
Likewise.

LT> Not only do they screw up diffstat (big deal), but they are pointless, LT> since 99.9% of the time the mode stays the same.

Pointless, yes. mode is not what screwing up diffstat but comparing against /dev/null is, so it is not a reason to hate mode, and my fingers learned to say diffstat -p1 already so it is not a big deal anymore.

LT> Normal "patch" will just ignore the extra lines before the LT> diff anyway, so it won't matter there.

LT> Comments?

I am 100% in agreement with you here. The only reason I added it was to match what Pasky does so that his cg-patch can eat its output. To me, pleasing cg-patch is far lower priority than pleasing l-k developers, so your veto counts.

My JIT tools do not use that mode thing in the patch. I apply a patch between two commits (or trees) to the work tree by doing something like this:

    GIT_EXTERNAL_DIFF=jit-diff-extract \
    jit-diff "$@" | {
        cd "${GIT_PROJECT_TOP}"
        sh
    }

Here jit-diff-extract is the gem that creates a small shell script that patches the file and runs "chmod +x" or "chmod -x" when necessary, and does git-update-cache for added or removed files. Its output would look something like this:

    patch -p1 <<\EOF
    --- /dev/null
    +++ fs/ext9/Makefile
    @@ ....
    EOF
    chmod -x 'fs/ext9/Makefile'
    git-update-cache --add --remove -- 'fs/ext9/Makefile'

Maybe I can make the default diff output just like the above? As you say, normal patch would not look at those shell script part at all anyway.

Previous: Linus TorvaldsNext: Linus Torvalds
Message 5 of 25 in “Resurrect diff-tree-helper -R”
  1. Resurrect diff-tree-helper -RJunio C Hamano, May 1, 2005
  2. Linus TorvaldsMay 1, 2005
  3. Daniel JacobowitzMay 1, 2005
  4. Linus TorvaldsMay 1, 2005
  5. Junio C HamanoMay 1, 2005
  6. Linus TorvaldsMay 1, 2005
  7. Junio C HamanoMay 1, 2005
  8. Add git-apply-patch-script.Junio C Hamano, May 1, 2005
  9. Rework built-in diff to make its output more dense.Junio C Hamano, May 1, 2005
  10. Petr BaudisMay 13, 2005
  11. Junio C HamanoMay 13, 2005
  12. Junio C HamanoMay 13, 2005
  13. Petr BaudisMay 13, 2005
  14. Junio C HamanoMay 13, 2005
  15. Junio C HamanoMay 14, 2005
  16. Petr BaudisMay 14, 2005
  17. Junio C HamanoMay 14, 2005
  18. Petr BaudisMay 14, 2005
  19. Junio C HamanoMay 15, 2005
  20. Petr BaudisMay 15, 2005
  21. Junio C HamanoMay 15, 2005
  22. Tweak diff output further to make it a bit less distracting.Junio C Hamano, May 15, 2005
  23. Petr BaudisMay 14, 2005
  24. Junio C HamanoMay 14, 2005
  25. Junio C HamanoMay 13, 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.