According to the git diff manual you should be able to do the following
git diff [options] <commit> <commit> [--] [<path>...]
I want to compare only *.h,*.c,*,*.cpp
files. So I tried something like the bellow after reading What option should be used restrict the git diff to a given set of file extensions?:
$ git diff --shortstat `git rev-list --since="jun 30 2014" --reverse origin/master | head -1`..`git rev-list --until="dec 31 2014" origin/master | head -1` -- `find -name '*.h' -print0`
I have tried the find -name '*.h' -print0
command and it prints out plenty of .h
files. But when I run the above whole command I get no result.
The following command also works fine:
git diff --shortstat `git rev-list --since="jun 30 2014" --reverse origin/master | head -1`..`git rev-list --until="dec 31 2014" origin/master | head -1`
It prints out
372 files changed, 31650 insertions(+), 9580 deletions(-)
But this I assume are for all files stored in the repo and I only want to know the difference among .h .c .cpp
files.
Perhaps you have a better idea or you see what might be the problem?