Currently, I have this setting:
format='%C(bold blue)%s' # Commit subject
format+='%C(auto)%d%n' # (HEAD -> master, origin/master)\n
format+='%C(yellow)%h%C(reset) ' # 4ae4a86
format+='%an, ' # John Doe,
format+='%C(magenta)%ar%C(reset) ' # 3 days ago
format+='at %C(cyan)%ad%n' # at 14:17\n (--date=format:%H:%M)
format+='%b' # Commit body
alias gl="git log --graph --all --pretty='$format' --date=format:%H:%M"
unset format
Which gives this:
Like git log --graph --oneline --all:
I want to swap the %d (ref names) with %s (subject):
format='%C(auto)%d ' # (HEAD -> master, origin/master)
format+='%C(bold blue)%s%n' # Commit subject\n
But it gives a leading space:
As an alternative to %d, there's %D, which removes the leading space and the parantheses. So I replaced %d with %D and wrap it in parentheses:
format='%C(auto)(%D) ' # (HEAD -> master, origin/master)
But now it looks like this:
So, how to remove the leading space from %d while still retaining the parentheses?



