From 8368eb5e07ba704108e9f7f4d795b5c1114043ef Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 4 Mar 2007 22:30:57 -0800 Subject: [PATCH] Add "Git monthly" summary script --- Summary | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 Summary diff --git a/Summary b/Summary new file mode 100755 index 0000000000..84c713e900 --- /dev/null +++ b/Summary @@ -0,0 +1,36 @@ +#!/bin/sh + +tmp=.git/summary-$$ +trap 'rm -f $tmp-*' 0 + +since="$1" +until="$2" + +git-rev-list --no-merges --since="$1" --until="$2" master >"$tmp-0.txt" +top=$(head -n 1 "$tmp-0.txt") +bottom=$(tail -n 1 "$tmp-0.txt") + +num_patches=$(git rev-list --no-merges $bottom..$top | wc -l) +git shortlog -s -n --no-merges $bottom..$top >"$tmp-0.txt" +num_contrib=$(wc -l <"$tmp-0.txt") + +summary=$(git diff --stat -M $bottom..$top | tail -n 1) +num_files=$(expr "$summary" : ' *\([1-9][0-9]*\) files changed') +num_added=$(expr "$summary" : '.*changed, \([1-9][0-9]*\) insertions') +num_deleted=$(expr "$summary" : '.*, \([1-9][0-9]*\) deletions') + +cat <