mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
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:
parent
aefe5c0f1c
commit
3662dd95bf
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue