diff.color=auto colors git log; Mercurial too?

Ted Pavlic ted at tedpavlic.com
Mon Dec 8 19:48:24 UTC 2008


Yeah, I figured I could use ANSI directly, but I was hoping there would 
be a more elegant solution... It would be terrific if there was a way to 
just say "color the first line of each log entry" regardless of what log 
template I'm using.

Thanks --
--Ted

Brodie Rao wrote:
> Here's an example, but you could go further and colorize more than
> just the first line:
> 
> [ui]
> logtemplate = "\033[33mchangeset:
> {rev}:{node|short}\033[0m\n{branches}{tags}{parents}user:
> {author}\ndate:
> {date|date}\n{files}{file_copies}description:\n{desc|strip}\n\n\n"
> 
> That would go in ~/.hgrc.
> 
> You can find more information about those control codes in
> console_codes(4) on Linux (see the section regarding "ECMA-48 Set
> Graphics Rendition"). The color extension bundled with Mercurial might
> also yield some clues about constructing color codes.
> 
> On Mon, Dec 8, 2008 at 2:29 PM, Ted Pavlic <ted at tedpavlic.com> wrote:
>> In git, setting
>>
>>        diff.color = auto
>>
>> will color the changeset line (i.e., the first line) in
>>
>>        git log
>>
>> output. It would be nice if we could do the same with "hg log".
>>
>> Is there a simple log style or setting that colors hg log in a similar way?
> 

-- 
Ted Pavlic <ted at tedpavlic.com>



More information about the Mercurial mailing list