Thread (2 messages) 2 messages, 2 authors, 2016-06-15

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

flat view

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:41:55

quoted
quoted
quoted
quoted
"LT" == Linus Torvalds [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help