summaryrefslogtreecommitdiff
path: root/pager.c
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2014-04-30 07:35:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-05-07 20:41:04 (GMT)
commitb3275838d969b7ecb91aae584226fccbeb046aca (patch)
tree2906218b9707f42caa5eaf7a1f1bae512fad35d6 /pager.c
parentd8779e1e2536bdd024254af14d2c046bba2bbb01 (diff)
downloadgit-b3275838d969b7ecb91aae584226fccbeb046aca.zip
git-b3275838d969b7ecb91aae584226fccbeb046aca.tar.gz
git-b3275838d969b7ecb91aae584226fccbeb046aca.tar.bz2
pager: remove 'S' from $LESS by default
By default, Git used to set $LESS to -FRSX if $LESS was not set by the user. The FRX flags actually make sense for Git (F and X because sometimes the output Git pipes to less is short, and R because Git pipes colored output). The S flag (chop long lines), on the other hand, is not related to Git and is a matter of user preference. Git should not decide for the user to change LESS's default. More specifically, the S flag harms users who review untrusted code within a pager, since a patch looking like: -old code; +new good code; [... lots of tabs ...] malicious code; would appear identical to: -old code; +new good code; Users who prefer the old behavior can still set the $LESS environment variable to -FRSX explicitly, or set core.pager to 'less -S'. The documentation in config.txt is made a bit longer to keep both an example setting the 'S' flag (needed to recover the old behavior) and an example showing how to unset a flag set by Git. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pager.c')
-rw-r--r--pager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pager.c b/pager.c
index 0cc75a8..f75e8ae 100644
--- a/pager.c
+++ b/pager.c
@@ -85,7 +85,7 @@ void setup_pager(void)
int i = 0;
if (!getenv("LESS"))
- env[i++] = "LESS=FRSX";
+ env[i++] = "LESS=FRX";
if (!getenv("LV"))
env[i++] = "LV=-c";
env[i] = NULL;