diff options
-rwxr-xr-x | contrib/git-stats.sh | 23 | ||||
-rwxr-xr-x | contrib/release.sh | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/contrib/git-stats.sh b/contrib/git-stats.sh new file mode 100755 index 00000000..735817a1 --- /dev/null +++ b/contrib/git-stats.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -e +set -o pipefail + +columns="Author,Commits,Changed Files,Insertions,Deletions" + +git shortlog -sn "$@" | +while read -r commits author; do + git log --author="$author" --pretty=tformat: --numstat "$@" | { + adds=0 + subs=0 + files=0 + while read -r a s f; do + adds=$((adds + a)) + subs=$((subs + s)) + files=$((files + 1)) + done + printf '%s;%d;%d;%+d;%+d;\n' \ + "$author" "$commits" "$files" "$adds" "-$subs" + } +done | +column -t -s ';' -N "$columns" -R "${columns#*,}" diff --git a/contrib/release.sh b/contrib/release.sh index 65f5d7b6..464eaadd 100755 --- a/contrib/release.sh +++ b/contrib/release.sh @@ -24,8 +24,8 @@ git -c core.commentchar='%' tag --edit --sign \ -m "Release $next_tag highlights:" \ -m "$changes" \ -m "Thanks to all contributors!" \ - -m "~\$ git shortlog -sn $prev_tag..$next_tag -$(git shortlog -sn $prev_tag..)" \ + -m "~\$ contrib/git-stats.sh $prev_tag..$next_tag +$(contrib/git-stats.sh $prev_tag..)" \ "$next_tag" echo "======= Pushing to remote..." |