From 3662dd95bf98eb2ccbb4ed8e37c337aa6e677a0d Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 8 Sep 2010 14:24:03 -0700 Subject: [PATCH] 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.. --- bin/git-summary | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/git-summary b/bin/git-summary index 9996b26..7014f09 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -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 \ No newline at end of file +echo