3 ############################################
4 # Script gathering statistics on a release #
5 ############################################
8 if [ "$#" -ne 2 -a "$#" -ne 1 ]; then
9 echo "Usage: $0 <GIMP_TAG_PREV> <GIMP_TAG_CUR>"
11 echo " GIMP_TAG_PREV: last tag release or commit (non-included in stats)"
12 echo " ex: GIMP_2_9_6"
13 echo " GIMP_TAG_CUR: current tag release or commit (included in stats); ex: GIMP_2_9_8"
14 echo " ex: GIMP_2_9_8."
15 echo " Optional. If absent, statistics up to HEAD."
20 git
--no-pager show
$PREV >/dev
/null
2>&1
22 echo "First tag is unknown: $PREV"
28 git
--no-pager show
$CUR >/dev
/null
2>&1
30 echo "Second tag is unknown: $CUR"
37 echo "## GIMP contributions between $PREV and $CUR ##"
41 contribs
=`git --no-pager shortlog -s -n $PREV..$CUR`
42 contribs_n
=`printf "$contribs" | wc -l`
43 commits_n
=`git log --oneline $PREV..$CUR | wc -l`
45 prev_date
=`git log -1 --format=%ci $PREV`
46 cur_date
=`git log -1 --format=%ci $CUR`
47 # I think this is not very portable, and may be a bash-specific syntax
48 # for arithmetic operations. XXX
49 days_n
=$
(( (`date -d "$cur_date" +%s` - `date -d "$prev_date" +%s`)/(60*60*24) ))
50 commits_rate
=$
(( $commits_n / $days_n ))
52 echo "Start date: $prev_date - End date: $cur_date"
53 echo "Between $PREV and $CUR, $contribs_n people contributed $commits_n commits to GIMP."
54 echo "This is an average of $commits_rate commits a day."
56 echo "Statistics on all files:" `git diff --shortstat $PREV..$CUR 2>/dev/null`
58 echo "Total contributor list:"
63 echo "## DEVELOPERS ##"
66 echo "Statistics on C files:" `git diff --shortstat $PREV..$CUR -- "*.[ch]" 2>/dev/null`
68 echo "Core developers:"
70 git
--no-pager shortlog
-s -n $PREV..
$CUR -- app
/ "libgimp*" pdb tools
/pdbgen
/
72 echo "Plugin and module developers:"
74 git
--no-pager shortlog
-s -n $PREV..
$CUR -- plug-ins
/ modules
/
77 echo "## TRANSLATIONS ##"
79 #git --no-pager log --stat $PREV..$CUR -- po* | grep "Updated\? .* translation"|sed "s/ *Updated\? \(.*\) translation.*/\\1/" | sort | uniq | paste -s -d, | sed 's/,/, /g'
81 i18n
=`git --no-pager log --stat $PREV..$CUR -- po* | grep "Updated\? .* \(translation\|language\)"`
82 i18n
=`printf "$i18n" | sed "s/ *Updated\? \(.*\) \(translation\|language\).*/\\1/" | sort | uniq`
83 i18n_n
=`printf "$i18n" | wc -l`
84 # It seems that if the last line has no newline, wc does not count it.
85 # Add one line manually.
86 i18n_n
=$
(( $i18n_n + 1 ))
87 i18n_comma
=`printf "$i18n" | paste -s -d, | sed 's/,/, /g'`
89 echo "$i18n_n translations were updated: $i18n_comma."
93 git
--no-pager shortlog
-sn $PREV..
$CUR -- "po*/*.po"
99 new_icons
=`git log --name-status $PREV..$CUR -- icons/ 2>/dev/null|grep "^A\s"|sed 's%^.*/\([^/]*\)\..*$%\1%' | sort | uniq`
100 icons_n
=`printf "$new_icons" | wc -l`
101 icons_comma
=`printf "$new_icons" | paste -s -d, | sed 's/,/, /g'`
103 if [ "$icons_n" -lt 20 ]; then
104 echo "$icons_n icons were added: $icons_comma"
106 echo "$icons_n icons were added (too many to list them all)."
109 echo "Icon designers:"
110 git
--no-pager shortlog
-sn $PREV..
$CUR -- "icons/*.svg" "icons/*.png"
112 echo "Theme designers:"
113 git
--no-pager shortlog
-sn $PREV..
$CUR -- "themes/*/gtkrc" "themes/*/*png"
115 echo "Resource creators:"
116 git
--no-pager shortlog
-sn $PREV..
$CUR -- data
/ etc
/ desktop
/ menus
/
119 echo "## Documenters ##"
122 git
--no-pager shortlog
-sn $PREV..
$CUR -- docs
/ devel-docs
/ NEWS INSTALL.
in "*README*" HACKING
125 echo "## Build maintainers ##"
128 echo "Core autotools build system:"
129 git
--no-pager shortlog
-sn $PREV..
$CUR -- configure.ac
"*/Makefile.am" "tools/"
131 echo "Binary builds:"
132 git
--no-pager shortlog
-sn $PREV..
$CUR -- build
/