Re: [PATCH for "next"] pretty-formats: add 'format:<string>'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Schindelin <Johannes.Schindelin@xxxxxx> 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.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]