Where is the format of git log --oneline --decorate defined?
Using git Iog --format=format:'my format', I cannot reproduce the colours of the branches, tags and HEAD as shown by git log --oneline --decorate.
git log --oneline --decorate
shows HEAD in light blue, the branch names in green and the punctuations (,,) in brown.
The closest I have come to getting what I want is:
git log --graph --abbrev-commit --decorate --date=short --format=format:'%C(bold blue)%h%C(reset) %C(bold green)%ad%C(reset)%d %C(white)%s%C(reset)' -20
with the only difference being that the branches/HEAD/tags are not coloured like with the previous command.
It does not appear to be possible with git version < 1.8.3.
Since git 1.8.3, one could use the colour %C(auto) token:
git log --graph --decorate --date=short --format='%C(bold blue)%h%C %C(bold green)%ad %C(auto)%d %C(white)%s%C(reset)' -10
The key element being:
%C(auto)%d ... %C(reset)
See also:
Color in git-log
Git pretty format colors
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With