diff options
Diffstat (limited to 'git-l')
-rwxr-xr-x | git-l | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -0,0 +1,15 @@ +#!/bin/bash + +width=$((`tput cols` - 10)) +width2=$(($width - 2)) + +if tty -s <&1; then + PRETTY='--pretty=format:%Cred%h %Cgreen%cd %Creset %s%x00%C(bold black)%an%Creset%C(yellow)%d' +else + PRETTY='--pretty=format:%h %cd %s%x00%an%d' +fi + +exec git log --abbrev-commit --date=short "$PRETTY" "$@" \ + |gawk --re-interval -F '\\0' \ + '{ printf "%-'$width's%s\n", gensub(/^(.{'$width2'}).{2,}$/, "\\1… ", 1, $1), $2 }' \ + |less -R |