dotfiles/home/private_bin/executable_git-l

20 lines
397 B
Text
Raw Normal View History

2024-08-06 11:30:25 -05:00
#!/usr/bin/env bash
COLUMNS=$(tput cols)
PREFIX='%C(bold magenta)%h%C(reset)'
SUFFIX='%C(dim white)%aN%C(reset)%C(auto)%d%C(reset)'
if [[ "$COLUMNS" -gt 100 ]]; then
format='%C(bold)%<(50,trunc)%s%C(reset) %C(green)%><(15,trunc)%ar%C(reset)'
else
format='%C(bold)%s%C(reset) %C(green)%as%C(reset)'
fi
format="$PREFIX $format $SUFFIX"
exec git \
log \
--format=tformat:"$format" \
"$@"