3 Existing=`cat .patchnum 2>/dev/null`
4 if [ -e ".patch" ]; then
5 Current=`awk '{print $4}' .patch`
6 elif [ -d ".git" ]; then
7 # we should do something better here
9 Changed=`git diff-index --name-only HEAD`
10 [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes"
13 if [ "$Existing" != "$Current" ]; then
14 echo "Updating .patchnum"
15 echo -n $Current > .patchnum
17 echo "Reusing .patchnum"