Created
April 19, 2016 04:08
-
-
Save bhcleek/3ff8b905701139d336ce431298940b2f to your computer and use it in GitHub Desktop.
cloc-per-tag
This file contains 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 characters
#!/bin/sh | |
ROOT="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
pushd "${ROOT}" | |
fmt=' | |
r=%(refname) | |
d=%(taggerdate:format:%F) | |
monday=$(date -j -f "%Y-%m-%d" -v+mon $d "+%Y-%m-%d") | |
git checkout %(refname) | |
echo $(basename %(refname)) - $monday: | |
cloc --exclude-dir=.git --json --quiet . | |
' | |
eval=`git for-each-ref --shell --format="$fmt" \ | |
--sort=-taggerdate \ | |
refs/tags` | |
eval "$eval" | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment