# git diff odds

3 messages from 2008-03-26 to 2008-03-27. Participants: Xavier Maillard, Linus Torvalds.
Thread: https://gitlist.dev/t/12866

## Xavier Maillard, 2008-03-26 01:00

Subject: git diff odds
Message-ID: <200803260100.m2Q10v2l005189@localhost.localdomain>
URL: https://gitlist.dev/e/200803260100.m2Q10v2l005189%40localhost.localdomain

```
Hi,

With LESS variable set as "-M", git diff displays escape sequence
instead of the colored ouput (as requested in my .git/config =>
color.diff=auto). If set to FRSX, it works perfectly.

Is this a bug ?

Regards,

	Xavier

P.S: I am unsubscribing from this list (too many messages) so
please keep me in the Cc to respond. Thank you.
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org

```

## Linus Torvalds, 2008-03-26 02:19

Subject: Re: git diff odds
Message-ID: <alpine.LFD.1.00.0803251914150.2775@woody.linux-foundation.org>
URL: https://gitlist.dev/e/alpine.LFD.1.00.0803251914150.2775%40woody.linux-foundation.org
In-Reply-To: <200803260100.m2Q10v2l005189@localhost.localdomain>

```


On Wed, 26 Mar 2008, Xavier Maillard wrote:
> 
> With LESS variable set as "-M", git diff displays escape sequence
> instead of the colored ouput (as requested in my .git/config =>
> color.diff=auto).

That's how 'less' works. It shows escape sequences as the escapes by 
default.

> If set to FRSX, it works perfectly.

It's the '-R' part that does the magic.

> Is this a bug ?

No, it's documented less behaviour. See "man less".

If you want to use "-M", you can mix it with R (or the other flags, for 
that matter) and use "LESS=MR" or "LESS=FRSXM" or whatever you like. But 
if you want less to pass through colors, you need that R there somewhere.

(You could use lower-case "r" too, but that's very dangerous, since it 
lets through _all_ escape sequences, including the ones that really screw 
up your terminal experience)

		Linus

```

## Xavier Maillard, 2008-03-27 01:00

Subject: Re: git diff odds
Message-ID: <200803270100.m2R101GJ003814@localhost.localdomain>
URL: https://gitlist.dev/e/200803270100.m2R101GJ003814%40localhost.localdomain
In-Reply-To: <alpine.LFD.1.00.0803251914150.2775@woody.linux-foundation.org>

```

   > Is this a bug ?

   No, it's documented less behaviour. See "man less".

Thank you very much for your explanations.

	Xavier
-- 
http://www.gnu.org
http://www.april.org
http://www.lolica.org

```
