Make git-summary take an optional commitish

This allows you to ask for a git summary based on a commitish, which is
very useful if you have a lot of project history. For example, if you
want a summary since the tag v42

$ git summary v42..
This commit is contained in:
Jonathan "Duke" Leto 2010-09-08 14:24:03 -07:00 committed by Tj Holowaychuk
parent aefe5c0f1c
commit 3662dd95bf

View file

@ -1,9 +1,11 @@
#!/bin/sh
COMMITISH=""
test $# -ne 0 && COMMITISH=$@
project=${PWD##*/}
commit_count=`git log --oneline | wc -l | tr -d ' '`
file_count=`git ls-files | wc -l | tr -d ' '`
authors=`git shortlog -n -s`
authors=`git shortlog -n -s $COMMITISH`
echo
echo " project: $project"
@ -11,4 +13,4 @@ echo " commits: $commit_count"
echo " files : $file_count"
echo " authors: "
echo "$authors"
echo
echo