Created
July 3, 2017 14:59
-
-
Save andrewchilds/319e98bfed18247db031fa4f7765a16f to your computer and use it in GitHub Desktop.
Revisions
-
andrewchilds created this gist
Jul 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,28 @@ #!/bin/bash set -e APP_DIR="$1" TEMP_FILE="codebase-age-histogram.txt" OUTPUT_FILE="codebase-age-histogram.csv" pushd $APP_DIR APP_FILES=`find . -type f -follow -print` rm -f $TEMP_FILE touch $TEMP_FILE for APP_FILE in $APP_FILES; do echo "Annotating $APP_FILE..." git annotate $APP_FILE | awk '{ print $4 }' >> $TEMP_FILE done sort -n $TEMP_FILE | uniq -c | sed -e 's/^ *//;s/ /,/' > $OUTPUT_FILE rm -f $TEMP_FILE echo "" echo "Done! Histogram CSV saved to $OUTPUT_FILE" popd