What's cooking 2008-09 #04
[git] / Summary
1 #!/bin/sh
2
3 tmp=.git/summary-$$
4 trap 'rm -f $tmp-*' 0
5
6 since="$1"
7 until="$2"
8
9 git rev-list --no-merges "master@{$1}..master@{$2}" >"$tmp-0.txt"
10 top="master@{$until}"
11 bottom="master@{$since}"
12
13 num_patches=$(git rev-list --no-merges $bottom..$top | wc -l)
14 git shortlog -s -n --no-merges $bottom..$top >"$tmp-0.txt"
15 num_contrib=$(wc -l <"$tmp-0.txt")
16
17 summary=$(git diff --stat -M $bottom..$top | tail -n 1)
18 num_files=$(expr "$summary" : ' *\([1-9][0-9]*\) files changed')
19 num_added=$(expr "$summary" : '.*changed, \([1-9][0-9]*\) insertions')
20 num_deleted=$(expr "$summary" : '.*, \([1-9][0-9]*\) deletions')
21
22 cat <<EOF
23 During the period of $since .. $until:
24
25         Number of contributors  : $num_contrib
26         Number of change sets   : $num_patches
27         Number of changed files : $num_files
28         Number of added lines   : $num_added
29         Number of deleted lines : $num_deleted
30
31 Changes during this period are as follows:
32
33 EOF
34
35 git shortlog -w72,2,4 --no-merges $bottom..$top
36