forked from alikins/gitconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-change-per-tag
executable file
·40 lines (33 loc) · 1001 Bytes
/
git-change-per-tag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# walk over a tito managed git repo, and show a rough summary of
# how much each tagged release changes. Not particular robust at
# the moment
declare -a releases
branch=
releases=( $(git log $1 --grep="Automatic" --format="format:%H") )
stats () {
changes=$(git diff --shortstat $1 $2)
echo $changes
# if [ -n "$bugs" ] ; then
# echo "$bugs"
# echo
# fi
}
#handle the special case of changes that aren't released yet
head=$(git log -n1 --format="format:%H")
echo "HEAD"
if [ "$head" != "${releases[0]}" ] ; then
stats $head ${releases[0]}
fi
count=${#releases[@]}
for (( i = 0 ; i < count; i++ ))
do
if [ -n "${releases[$i]}" ] && [ -n "${releases[$i+1]}" ] ; then
version=$(git describe --exact-match "${releases[$i]}")
# if we want to show the previous release
#git describe --exact-match "${releases[$i+1]}"
diffstats=$(stats ${releases[$i]} ${releases[$i+1]})
printf "%-30.30s %s\n" "$version" "$diffstats"
#echo -e "\t $diffstats"
fi
done