dotfiles/.local/bin/scripts/git-ln
2022-05-03 11:22:10 +02:00

5 lines
268 B
Bash
Executable file

#!/bin/bash
set -o pipefail
upCount=$(git rev-list --count HEAD...@{push} 2>/dev/null)
count=$(expr ${upCount:-0} + 3 \& ${upCount:-0} \> 3 \& ${upCount:-0} \< 6 \| 6)
git --no-pager lo -$count --color=always --graph HEAD @{upstream} "$@" || git --no-pager lo -7 "$@"