V: pay attention to dirty versions
[git/spearce.git] / Summary
blob951bc9f9aa95a9e8028a70c7c99101158c790ec4
1 #!/bin/sh
3 tmp=.git/summary-$$
4 trap 'rm -f $tmp-*' 0
6 since="$1"
7 until="$2"
9 git rev-list --no-merges "master@{$1}..master@{$2}" >"$tmp-0.txt"
10 top="master@{$until}"
11 bottom="master@{$since}"
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")
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')
22 cat <<EOF
23 During the period of $since .. $until:
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
31 Changes during this period are as follows:
33 EOF
35 git shortlog -w72,2,4 --no-merges $bottom..$top