Skip to content

Instantly share code, notes, and snippets.

@yasuharu519
Last active January 28, 2017 11:20
Show Gist options
  • Save yasuharu519/bded5a4aecfe4dbe3bd0 to your computer and use it in GitHub Desktop.
Save yasuharu519/bded5a4aecfe4dbe3bd0 to your computer and use it in GitHub Desktop.
git-today script
#!/bin/sh
LAST_BEFORE_TODAY=$(git log --oneline --until='yesterday 23:59:59' | head -1 | cut -d' ' -f 1)
AUTHOR="sawada_yasuharu"
echo "---------- git commit num today ---------"
git rev-list ${LAST_BEFORE_TODAY}..HEAD --count --author=${AUTHOR}
echo "---------- git commit summary today ---------"
git log ${LAST_BEFORE_TODAY}..HEAD --oneline --author=${AUTHOR}
echo "---------- git diff summary today ---------"
git log --numstat --author=${AUTHOR} ${LAST_BEFORE_TODAY}..HEAD | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d lines add\n-%d lines delete\n", plus, minus)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment