Re: [PATCH for "next"] pretty-formats: add 'format:<string>'
- From
Junio C Hamano <junkio@cox.net>
- Date
- Feb 23, 2007, 06:21 UTC
- Message-ID
- <7vslcx9ywx.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.63.0702230125270.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 9 quoted lines
> 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"?
Show 5 quoted lines
> 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.