Skip to content

Instantly share code, notes, and snippets.

@spenserpothier
Last active August 16, 2017 20:22
Show Gist options
  • Save spenserpothier/4a8b4899f18f579870d7ca0624a3ad5b to your computer and use it in GitHub Desktop.
Save spenserpothier/4a8b4899f18f579870d7ca0624a3ad5b to your computer and use it in GitHub Desktop.
Script to figure out how much code type work I did this week
#!/bin/zsh
ls -1 -d */ | while read i
do
cd "$i"
if [ -d .git ]
then
{
ncommits=$(eval 'git log --oneline --author="Spenser" --since="`date -v monday`" | wc -l' 2> /dev/null )
} || {
ncommits=-1
}
if [ $ncommits -gt 0 ]
then
echo "------------ $i ------------"
git --no-pager log --since="`date -v monday`" --stat --author="Spenser" --oneline
fi
fi
cd ~/source/
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment