threads / patch / 31963

patchDocumentation: improve the example of overriding LESS via core.pager

Subject: [PATCH] Documentation: improve the example of overriding LESS via core.pager

## tl;dr

2 messages between Oct 28, 2012 and Oct 29, 2012. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Patrick Palka· Oct 28, 2012, 20:12 UTC · lore

You can override an option set in the LESS variable by simply prefixing the command line option with `-+`. This is more robust than the previous example if the default LESS options are to ever change.

Signed-off-by: Patrick Palka <patrick@parcs.ath.cx>
---
 Documentation/config.txt |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Show changes to Documentation/config.txt +4 −4
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 11f320b..9a0544c 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -538,14 +538,14 @@ core.pager::
 	`LESS` variable to some other value.  Alternately,
 	these settings can be overridden on a project or
 	global basis by setting the `core.pager` option.
-	Setting `core.pager` has no affect on the `LESS`
+	Setting `core.pager` has no effect on the `LESS`
 	environment variable behaviour above, so if you want
 	to override git's default settings this way, you need
 	to be explicit.  For example, to disable the S option
 	in a backward compatible manner, set `core.pager`
-	to `less -+$LESS -FRX`.  This will be passed to the
-	shell by git, which will translate the final command to
-	`LESS=FRSX less -+FRSX -FRX`.
+	to `less -+S`.  This will be passed to the shell by
+	git, which will translate the final command to
+	`LESS=FRSX less -+S`.
 
 core.whitespace::
 	A comma separated list of common whitespace problems to
-- 
1.7.10.4
Jeff King· Oct 29, 2012, 06:26 UTC · re: Patrick Palka · lore

Re: [PATCH] Documentation: improve the example of overriding LESS via core.pager

On Sun, Oct 28, 2012 at 04:12:46PM -0400, Patrick Palka wrote:
> You can override an option set in the LESS variable by simply prefixing
> the command line option with `-+`. This is more robust than the previous
> example if the default LESS options are to ever change.

Yeah, the current description is quite tortured and complex. I wondered if there might be some reason, but I think it is simply that fee7545 was over-zealous in adopting the original text. Yours is much more sensible.

Thanks.
-Peff

← back to recent threads