From: Junio C Hamano Date: Fri, 23 Feb 2007 06:21:50 GMT Subject: Re: [PATCH for "next"] pretty-formats: add 'format:' Message-ID: <7vslcx9ywx.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Johannes Schindelin 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.