Re: [PATCH 2/2] expand --pretty=format color options

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

 



Jeff King schrieb:
> Currently, the only colors available to --pretty=format
> users are red, green, and blue. Rather than expand it with a
> few new colors, this patch makes the usual config color
> syntax available, including more colors, backgrounds, and
> attributes.
> 
> Because colors are no longer bounded to a single word (e.g.,
> %Cred), this uses a more advanced syntax that features a
> beginning and end delimiter (but the old syntax still
> works). So you can now do:
> 
>   git log --pretty=tformat:'%C(yellow)%h%C(reset) %s'
> 
> to emulate --pretty=oneline, or even
> 
>   git log --pretty=tformat:'%C(cyan magenta bold)%s%C(reset)'
> 
> if you want to relive the awesomeness of 4-color CGA.
> 
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
> René: I saw you mention an end goal of implementing the other --pretty
> formats in terms of --pretty=format:. So maybe this will help just a
> little.

Nice!

Another step would be for --pretty=format to respect the color config,
i.e. it shouldn't print any colour codes if colouring is turned off or
if set to auto while writing to file or pipe.

René
--
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]

  Powered by Linux