Skip to content

Instantly share code, notes, and snippets.

@tudormunteanu
Created September 6, 2012 13:52
Show Gist options
  • Select an option

  • Save tudormunteanu/3656469 to your computer and use it in GitHub Desktop.

Select an option

Save tudormunteanu/3656469 to your computer and use it in GitHub Desktop.
git improvements
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)/' |
# Line columns up based on } delimiter
column -s '}' -t |
# Page only if we need to
less -FXRS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment