Re: [PATCH for "next"] pretty-formats: add 'format:<string>'
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 23, 2007, 11:48 UTC
- Message-ID
- <Pine.LNX.4.63.0702231237500.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7vslcx9ywx.fsf@assigned-by-dhcp.cox.net>
Hi,
On Thu, 22 Feb 2007, Junio C Hamano wrote:
Show 13 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> 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"?
Vy, it iss korrekt Churmen Inklish [Translation: Why, it is correct German "English"]... ;-)
Show 8 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?
But those placeholders are so long! Not even GNU date supports such long placeholders... And I could not reuse interpolate.[ch] as is for that.
> 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".
Same goes here: interpolate.[ch] does not (yet) allow for that.
Show 7 quoted lines
> > '%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.
And again...
Show 5 quoted lines
> > > --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".
This would be easy, methink, to teach to interpolate().
Maybe I can overcome my laziness, and extend interpolate() so that it can actually call callbacks with callback data...
Alternatively, I could imitate for-each-ref, and roll my own interpolate()? :-)
Ciao, Dscho