ref: e326c6c9a4b987d7e9217e6cea46a48f37d8f38c
./git_helpers
#!/usr/bin/env sh
HASH="%C(yellow)%h%Creset"
RELATIVE_TIME="%Cgreen(%ar)%Creset"
AUTHOR="%C(bold blue)%an%Creset"
REFS="%C(bold red)%d%Creset"
SUBJECT="%s"
FORMAT="$HASH}$RELATIVE_TIME}$AUTHOR}$REFS $SUBJECT"
function pretty_git_log() {
git log --graph --pretty="tformat:$FORMAT" $* |
# Replace (2 years ago) with (2 years)
sed -Ee 's/(^[^<]*) ago\)/\1)/' |
# Replace (2 years, 5 months) with (2 years)
sed -Ee 's/(^[^<]*), [[:digit:]]+ .*months?\)/\1)/' |
column -s '}' -t |
less -FXRS
}