summaryrefslogtreecommitdiff
path: root/pkg/scripts/stats.sh
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-04-04 16:58:18 -0300
committerTomás Touceda <chiiph@leap.se>2014-04-04 16:58:18 -0300
commit81715dc47d77934c4f67d2527a56c28f58f0345d (patch)
tree6e66940af735e089803c5ce05ad1ce1df16c9d1e /pkg/scripts/stats.sh
parent496036f15cf257d16b6594770812da64a249280c (diff)
parenteb4cdab9c6b8ff66bb4667cc6195d2c366122540 (diff)
Merge branch 'release-0.5.0'
Diffstat (limited to 'pkg/scripts/stats.sh')
-rwxr-xr-xpkg/scripts/stats.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/pkg/scripts/stats.sh b/pkg/scripts/stats.sh
new file mode 100755
index 00000000..2b7a8b18
--- /dev/null
+++ b/pkg/scripts/stats.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+REPOSITORIES="bitmask_client leap_pycommon soledad keymanager leap_mail"
+
+CHANGED=0
+INSERTIONS=0
+DELETIONS=0
+MERGES_TOTAL=0
+
+echo "Changes summary between closest annotated tag to HEAD"
+echo "====================================================="
+echo
+
+for repo in $REPOSITORIES; do
+ cd $repo
+ echo "Stats for: $repo"
+ # the 'describe' command gives the closest annotated tag
+ STATS=$(git diff --shortstat `git describe --abbrev=0`..HEAD)
+ MERGES=$(git log --merges `git describe --abbrev=0`..HEAD | wc -l)
+ echo "Stats:$STATS"
+ echo "Merges: $MERGES"
+ VALUES=(`echo $STATS | awk '{ print $1, $4, $6 }'`) # use array to store values
+ CHANGED=$(echo $CHANGED + ${VALUES[0]} | bc)
+ INSERTIONS=$(echo $INSERTIONS + ${VALUES[1]} | bc)
+ DELETIONS=$(echo $DELETIONS + ${VALUES[2]} | bc)
+ MERGES_TOTAL=$(echo $MERGES_TOTAL + $MERGES | bc)
+ echo "----------------------------------------------------------------------"
+ cd ..
+done
+
+echo
+echo "TOTAL"
+echo "Stats: $CHANGED files changed, $INSERTIONS insertions(+), $DELETIONS deletions(-)"
+echo "Merges: $MERGES_TOTAL"