A dirty but working solution
Use git ls-tree to get the SHA1 identifier of the files on the commits you want to compare then use git diff [options] <blob> <blob> and provide the two SHA1 identifiers as arguments.
$ git ls-tree commit1 dir1/dir2/file1.txt 100644 blob 7d252b754d46a8fcd0613a96710c9326942d7a92 dir1/dir2/file1.txt $ git ls-tree commit2 dirA/fileB.txt 100644 blob 4d000ed739c880a26686a2843dae6eeeb4109a37 dirA/fileB.txt $ git diff 7d252b754d46a8fcd0613a96710c9326942d7a92 4d000ed739c880a26686a2843dae6eeeb4109a37
If you need to do this frequently you can even pack everything in a small shell script:
#!/bin/bash # This script does not validate its command line arguments! COMMIT1=$1 FILE1=$2 COMMIT2=$3 FILE2=$4 BLOB1=$(git ls-tree $COMMIT1 $FILE1 | cut -f3 -d' ' | cut -f1) BLOB2=$(git ls-tree $COMMIT2 $FILE2 | cut -f3 -d' ' | cut -f1) git diff $BLOB1 $BLOB2
Run it as:
$ script.sh commit1 dir1/dir2/file1.txt commit2 dirA/fileB.txt