ref: 9170f6a857dce13be1281eafbff2e33ef5db1be5
./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
}