git log -p
uses actually a git diff
option (--patch
)
If git log -- x.txt
doesn't show at all the expected commit, then it simply means that commit didn't introduced any diff for that file.
A git diff -- x.txt
for that commit would be empty.
After extensive discussion, this work (which would mean x.txt
was renamed or moved at some point):
git log --follow -M -p -- x.txt
There is another case where git log -p -- x.txt
wouldn't include a commit:
That -p
option will compare a commit with the previous one for a given file, unless that file was created (in which case, there is no previous commit for that file)
That means a git log -p -- x.txt
won't include the first commit, when the file was initially added.
That "diff" would simply be the full content of x.txt
.
In the OP Yarin Gold's case, though:
All that with a git version 1.9.3 (Apple Git-50) on OS X (10.9.5).