I would like to get a list of all files, which have changed betweet two commits including those in submodules.
I know I can do this:
git diff --name-
So, the very straightforward script that lists all changes compared to a revision
#!/bin/sh
echo "Listing changes for super module"
git diff $1 --name-only
subs=(`git submodule | awk '{print $2}'`)
for sub in ${subs[*]}; do
lastrevision=`git diff $1 $sub | fgrep "Subproject" | head -n1 | awk '{print $3}'`
cd $sub
echo "Listing changes for $sub"
git diff $lastrevision --name-only
cd ..
done
it takes one argument - revision you want to compare with.
Make sure that there is fgrep "Subproject"
, not fgrep "Submodule"
.