Re: [PATCH for "next"] pretty-formats: add 'format:<string>'
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:56
Johannes Schindelin [off-list ref] writes:
With this patch, $ git show -s \ --pretty=format:' Ze komit %h woss%n dunn buy ze great %an' shows something like Ze komit 04c5c88 woss dunn buy ze great Junio C Hamano
Does it say "This commit is by a fool whose name is blah"?
The supported placeholders are: '%H': commit hash ... '%b': body
Hmmm. Would we want to make them somehow interoperable with git-for-each-ref format atoms? Also, it _might_ be worthwhile to do something like "%+4b" which means "indent each line of this field with 4 spaces", for a multi-line field like "%b".
'%Cred': switch color to red '%Cgreen': switch color to green '%Cblue': switch color to blue '%Creset': reset color
Hmmm. I strongly suspect that we would want to reuse code to grok colors and attributes in color.c.
> --format 'committer %c\nauthor %a\n' > > this catches all combinations, and is easier for scripting.
I do not have strong preference between "\n" and "%n".
So, I overcame my laziness after 91 days...
Thanks.