app: s/sprintf/g_snprintf/ in xcf_save_image()
[gimp.git] / devel-docs / release-stats.sh
blob70d63073716f90b9c93f2f9fa336672fa5b9ad1c
1 #!/bin/sh
3 ############################################
4 # Script gathering statistics on a release #
5 ############################################
7 #### Usage ####
8 if [ "$#" -ne 2 -a "$#" -ne 1 ]; then
9 echo "Usage: $0 <GIMP_TAG_PREV> <GIMP_TAG_CUR>"
10 echo
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."
16 exit 1
19 PREV=$1
20 git --no-pager show $PREV >/dev/null 2>&1
21 if [ $? -ne 0 ]; then
22 echo "First tag is unknown: $PREV"
23 exit 2
26 if [ "$#" = 2 ]; then
27 CUR=$2
28 git --no-pager show $CUR >/dev/null 2>&1
29 if [ $? -ne 0 ]; then
30 echo "Second tag is unknown: $CUR"
31 exit 2
33 else
34 CUR='HEAD'
37 echo "## GIMP contributions between $PREV and $CUR ##"
38 echo
40 # Main stats:
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."
55 echo
56 echo "Statistics on all files:" `git diff --shortstat $PREV..$CUR 2>/dev/null`
57 echo
58 echo "Total contributor list:"
59 printf "$contribs"
61 echo
62 echo
63 echo "## DEVELOPERS ##"
64 echo
66 echo "Statistics on C files:" `git diff --shortstat $PREV..$CUR -- "*.[ch]" 2>/dev/null`
67 echo
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/
76 echo
77 echo "## TRANSLATIONS ##"
78 echo
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."
90 echo
92 echo "Translators:"
93 git --no-pager shortlog -sn $PREV..$CUR -- "po*/*.po"
95 echo
96 echo "## DESIGN ##"
97 echo
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"
105 else
106 echo "$icons_n icons were added (too many to list them all)."
108 echo
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/
118 echo
119 echo "## Documenters ##"
120 echo
122 git --no-pager shortlog -sn $PREV..$CUR -- docs/ devel-docs/ NEWS INSTALL.in "*README*" HACKING
124 echo
125 echo "## Build maintainers ##"
126 echo
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/