When I invoke the following command:
git log --format=format:"%C(yellow)%h %C(blue)%s %C(green)%ad %C(reset)%an%n%n%-b"
I get output that looks like this:
I would like the commit bodies to be dimmed, so I tried inserting the instruction %C(dim)
at the end of my format string. However, there does not seem to be an insertion location that achieves my goal:
Inserting
%C(dim)
after the newlines and before the (conditional newline-chomping)%-b
command correctly applies the dimming effect, but breaks conditional newline-chomping:git log --format=format:"%C(yellow)%h %C(blue)%s %C(green)%ad %C(reset)%an%n%n%C(dim)%-b"
Inserting
%C(dim)
before both the newlines and the (conditional newline-chomping)%-b
command correctly retains conditional newline-chomping, but fails to apply the dimming effect (i.e. no change from original output):git log --format=format:"%C(yellow)%h %C(blue)%s %C(green)%ad %C(reset)%an%C(dim)%n%n%-b"
Additionally, I cannot move the 'chomp' operator -
to the color command, since that always appears to "evaluate" to a non-empty string (and therefore, newlines are not chomped).
Is there a way to achieve my goal?
--format=tformat:
is similar to--format=format:
but it adds a newline after the last line of output which helps to slightly shorten the sed script – Misogynist