Re: git diff odds
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Mar 26, 2008, 02:19 UTC
- Message-ID
- <alpine.LFD.1.00.0803251914150.2775@woody.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