Dmitry Nikulin <pastafariant@xxxxxxxxx> writes: > $ env GIT_EXTERNAL_DIFF=./print_argv.py git diff > origin/branch1:file1.txt origin/branch2:file2.txt I didn't even know external-diff driver is called (and does not even segfaut) in the "compare two blobs" hack codepath. The syntax <tree-ish>:<path-in-the-tree> you have on the command line resolves to a blob object name. There is no leading directory name, there is no permission bits or executable bit, there is no filename, when "diff" is told to compare two blob objects this way. THe "diff" machinery that drives the external (or internal for that matter) diff will only get two 40-hex blob object names and nothing else. The only pieces of information you can trust among those the external program may receive are the blob object name(s) and the contents stored in the temporary files given to it. The location of these temporary files or their mode bits have no relation to the "files" in some tree in the original repository, as that information is long lost when you write <tree-ish>:<path-in-the-tree> to tell Git to use that as a blob object name. $ git diff -M branch1 branch2 -- file1 file2 if file1 and file2 have similar-enough contents, may have a better chance of what you wanted to ask Git (if I am guessing what it is, that is).