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