From f51e10153f8be5ff2ef12d3d39a802ec0689cc9d Mon Sep 17 00:00:00 2001 From: mg Date: Tue, 14 Feb 2023 10:34:07 +0100 Subject: [PATCH] glogs als funktion --- .bash_extra | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.bash_extra b/.bash_extra index e68849e..fcfbce3 100644 --- a/.bash_extra +++ b/.bash_extra @@ -203,6 +203,17 @@ EOF ;; 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 # tmux alias tmuxa="tmux a -t " @@ -233,7 +244,6 @@ alias gf="git fetch" alias gdel="git add . && git stash && git stash clear" alias glast="git log -1 HEAD --stat" 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 alias v="view" # docker