Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/query-git-stats.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/query-git-stats.sh b/scripts/query-git-stats.sh
new file mode 100755
index 0000000000..94e846e106
--- /dev/null
+++ b/scripts/query-git-stats.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+EXCLUDED_FILES="/\.xml$/d;/\.txt$/d;/package-info\.java/d;/\.yml$/d;/\.md$/d;/\.mod$/d"
+EXCLUDED_PATHS="/jetty-ant\//d;/tests\//d;/examples\//d;/\/src\/test\//d"
+
+FILTEREDLOG=git-filtered.log
+
+git log \
+ --after '2015-12-01 00:00' \
+ --until '2016-03-31 23:59' \
+ --oneline > $FILTEREDLOG
+
+UNIQCOMMITS=$(cat $FILTEREDLOG | wc -l)
+
+git log \
+ --after '2015-12-01 00:00' \
+ --until '2016-03-31 23:59' \
+ --numstat --format= | sed \
+ -e "$EXCLUDED_FILES" \
+ -e "$EXCLUDED_PATHS" \
+ | sort --key=3 > $FILTEREDLOG
+
+UNIQFILES=$(cat $FILTEREDLOG | cut -f 3- | uniq | wc -l)
+
+# Show output
+echo "$UNIQCOMMITS unique commits"
+echo "$UNIQFILES unique files"
+cat $FILTEREDLOG | awk '{total = total + $1}END{print total " lines added"}'
+cat $FILTEREDLOG | awk '{total = total + $2}END{print total " lines removed"}'
+
+rm $FILTEREDLOG
+

Back to the top