Skip to content

Instantly share code, notes, and snippets.

@daniele-xp
Last active December 20, 2017 10:59
Show Gist options
  • Save daniele-xp/abbeb4955324ee3560825975ca2c9327 to your computer and use it in GitHub Desktop.
Save daniele-xp/abbeb4955324ee3560825975ca2c9327 to your computer and use it in GitHub Desktop.
Git log script for TR in Phoenix and MobilePOS code reviews
#!/bin/bash
LOG_START_DATE="2016-01-01"
function log(){
cardNumber=$1
options=""
if [ "x$2" = "xdiff" ] ; then
options="$options --stat -p"
if [ "x$3" = "xspaces" ] ; then
options="$options -w --color-words"
fi
else
options="$options --oneline"
fi
git log --reverse --grep "\[$cardNumber\]" --after=$LOG_START_DATE $options
}
echo "git log starting from $LOG_START_DATE"
if test $1; then
log $1 $2 $3
else
git log --oneline --after=$LOG_START_DATE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment