mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 15:36:21 -04:00
26 lines
528 B
Bash
Executable file
26 lines
528 B
Bash
Executable file
#!/bin/sh
|
|
|
|
commit=""
|
|
test $# -ne 0 && commit=$@
|
|
project=${PWD##*/}
|
|
|
|
commit_count=`git log --oneline $commit | wc -l | tr -d ' '`
|
|
file_count=`git ls-files | wc -l | tr -d ' '`
|
|
authors=`git shortlog -n -s $commit | awk '
|
|
{ args[NR] = $0; sum += $0 }
|
|
END {
|
|
for (i = 1; i <= NR; ++i) {
|
|
printf "%-30s %2.1f%%\n", args[i], 100 * args[i] / sum
|
|
}
|
|
}'`
|
|
|
|
echo
|
|
echo " project: $project"
|
|
echo " commits: $commit_count"
|
|
if test "$commit" = ""; then
|
|
echo " files : $file_count"
|
|
fi
|
|
echo " authors: "
|
|
echo "$authors"
|
|
echo
|