threads / discuss / 12866

git diff odds

Subject: git diff odds

## tl;dr

3 messages between Mar 26, 2008 and Mar 27, 2008.

replies: 2people: 2as markdown or json

Xavier Maillard· Mar 26, 2008, 01:00 UTC · lore
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· Mar 26, 2008, 02:19 UTC · re: Xavier Maillard · lore

Re: git diff odds

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

← back to recent threads