From 14052742d0d9818744d8e6afd7a7fd214e15260e Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 18 Mar 2016 10:42:17 -0700 Subject: [PATCH] Adding some git query scripts for information gathering --- scripts/query-git-stats.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 scripts/query-git-stats.sh diff --git a/scripts/query-git-stats.sh b/scripts/query-git-stats.sh new file mode 100755 index 00000000000..94e846e1066 --- /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 +