Fix commit and file count in git-summary with a commitish

This commit is contained in:
Jonathan "Duke" Leto 2010-09-08 14:33:48 -07:00 committed by Tj Holowaychuk
parent 0bc7afe27e
commit 843fc7ad11

View file

@ -3,14 +3,16 @@
COMMITISH=""
test $# -ne 0 && COMMITISH=$@
project=${PWD##*/}
commit_count=`git log --oneline | wc -l | tr -d ' '`
commit_count=`git log --oneline $COMMITISH | wc -l | tr -d ' '`
file_count=`git ls-files | wc -l | tr -d ' '`
authors=`git shortlog -n -s $COMMITISH`
echo
echo " project: $project"
echo " commits: $commit_count"
echo " files : $file_count"
if test "$COMMITISH" = ""; then
echo " files : $file_count"
fi
echo " authors: "
echo "$authors"
echo