glogs als funktion

This commit is contained in:
Michael Grote 2023-02-14 10:34:07 +01:00
parent 4cf97b17f1
commit f51e10153f

View file

@ -203,6 +203,17 @@ EOF
;; ;;
esac esac
} }
function glogs {
# https://git-scm.com/docs/pretty-formats
# https://stackoverflow.com/questions/3631005/git-log-tabular-formatting
# https://stackoverflow.com/questions/7736781/how-to-make-git-log-not-prompt-to-continue
if [ -z "$1" ]; then
ncommits=30
else
ncommits="$1"
fi
git --no-pager log --pretty=format:'%C(auto) %<|(16,trunc)%h %<|(60,trunc)%s %Cgreen%cr%Creset by %Cblue%an%Creset' --graph --all -$ncommits
}
### Aliase ### Aliase
# tmux # tmux
alias tmuxa="tmux a -t " alias tmuxa="tmux a -t "
@ -233,7 +244,6 @@ alias gf="git fetch"
alias gdel="git add . && git stash && git stash clear" alias gdel="git add . && git stash && git stash clear"
alias glast="git log -1 HEAD --stat" alias glast="git log -1 HEAD --stat"
alias gd="git diff" alias gd="git diff"
alias glogs="git log --all --graph --pretty=format:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
# vim # vim
alias v="view" alias v="view"
# docker # docker