Skip to contentSkip to conversation

git diff odds

DISCUSSION Xavier Maillard 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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.

Signature · 3 lines
http://www.gnu.org
http://www.april.org
http://www.lolica.org
#1 lore raw
Quoted 4 lines · Xavier Maillard

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.

Quoted 1 line

If set to FRSX, it works perfectly.

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

Quoted 1 line

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

#2 lore raw
Quoted 2 lines

Is this a bug ?

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

Thank you very much for your explanations.

Xavier

Signature · 3 lines
http://www.gnu.org
http://www.april.org
http://www.lolica.org