{"thread":{"id":"9574","subject":"[RFC] Clean way to disable pager","startedAt":"2007-08-19T17:26:07Z","lastAt":"2007-08-21T09:19:16Z","messageCount":15,"participants":["Matthieu Moy","Linus Torvalds","Brian Gernhardt","Junio C Hamano","Alex Riesen","Adam Roben","David Kastrup","Jakub Narebski","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51001","messageId":"vpq1wdz307k.fsf@bauges.imag.fr","threadId":"9574","inReplyTo":null,"subject":"[RFC] Clean way to disable pager","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-19T17:26:07Z","receivedAt":"2007-08-19T17:26:07Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Hi,\n\nThe man page for git documents the -p option to _enable_ the paginated\noutput for git, which isn't very usefull since the commands that might\nactually need paging have it enabled by default.\n\nWhat I can't find is a clean way to _disable_ the pager. A hacky way\nis to run \"git whatever | cat\", or \"GIT_PAGER=cat git whatever\". From\nthe code, it seems that git doesn't even launch the pager if it's set\nto \"cat\".\n\nI think that deserves an less-hacky, and documented way. I'd suggest a\n--no-pager, or --dont-paginate, that would do the opposite of -p as a\nglobal option for git.\n\nBelow is a patch that does this:\n\n\n\n\n>From 2148c2564ca6480feaec9a9d091259032257918d Mon Sep 17 00:00:00 2001\nFrom: Matthieu Moy <Matthieu.Moy@imag.fr>\nDate: Sun, 19 Aug 2007 19:24:36 +0200\nSubject: [PATCH] Add and document a global --no-pager option for git.\n\nTo keep the change small, this is done by setting GIT_PAGER to \"cat\". I'd\nprefer not using global/environment variables for that, but it would\nrequire a complete refactoring of options handling in git.\n---\n Documentation/git.txt |    6 +++++-\n git.c                 |    6 +++++-\n 2 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 8017997..707a756 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -9,7 +9,8 @@ git - the stupid content tracker\n SYNOPSIS\n --------\n [verse]\n-'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]\n+'git' [--version] [--exec-path[=GIT_EXEC_PATH]] \n+    [-p|--paginate] [--no-pager]\n     [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n     [--help] COMMAND [ARGS]\n \n@@ -103,6 +104,9 @@ OPTIONS\n -p|--paginate::\n        Pipe all output into 'less' (or if set, $PAGER).\n \n+--no-pager::\n+       Do not pipe git output into a pager.\n+\n --git-dir=<path>::\n        Set the path to the repository. This can also be controlled by\n        setting the GIT_DIR environment variable.\ndiff --git a/git.c b/git.c\nindex cab0e72..f280e7d 100644\n--- a/git.c\n+++ b/git.c\n@@ -4,7 +4,7 @@\n #include \"quote.h\"\n \n const char git_usage_string[] =\n-       \"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]\";\n+       \"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND\n [ARGS]\";                                                                                                                                                   \n \n static void prepend_to_path(const char *dir, int len)\n {\n@@ -58,6 +58,10 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)\n                        }\n                } else if (!strcmp(cmd, \"-p\") || !strcmp(cmd, \"--paginate\")) {\n                        setup_pager();\n+               } else if (!strcmp(cmd, \"--no-pager\")) {\n+                       setenv(\"GIT_PAGER\", \"cat\", 1);\n+                       if (envchanged)\n+                               *envchanged = 1;\n                } else if (!strcmp(cmd, \"--git-dir\")) {\n                        if (*argc < 2) {\n                                fprintf(stderr, \"No directory given for --git-dir.\\n\" );\n-- \n1.5.3.rc0.64.gf4f4a-dirty\n\n\n\n-- \nMatthieu\n"},{"id":"51002","messageId":"vpqwsvr1kxz.fsf@bauges.imag.fr","threadId":"9574","inReplyTo":"vpq1wdz307k.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-19T17:41:12Z","receivedAt":"2007-08-19T17:41:12Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> What I can't find is a clean way to _disable_ the pager. A hacky way\n> is to run \"git whatever | cat\", or \"GIT_PAGER=cat git whatever\". \n\nI juste realized that the second way is actually documented:\n\n\n'GIT_PAGER'::\n\tThis environment variable overrides `$PAGER`. If it is set\n\tto an empty string or to the value \"cat\", git will not launch\n\ta pager.\n\nStill, I find this a bit too hidden in the documentation. I'd expect\nto find the way to disable the pager close to the place where I find\nthe way to enable it. Perhaps something like this would do:\n\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -101,7 +101,8 @@ OPTIONS\n \tthe current setting and then exit.\n \n -p|--paginate::\n-\tPipe all output into 'less' (or if set, $PAGER).\n+\tPipe all output into 'less' (or if set, $GIT_PAGER or $PAGER).\n+\tSee the documentation of GIT_PAGER below to disable the pager.\n \n --git-dir=<path>::\n \tSet the path to the repository. This can also be controlled by\n\n\nOr perhaps move the sentence about \"cat\" from the documentation of\nGIT_PAGER to the one of --paginate (neither place is really\nappropriate, it's not specific to GIT_PAGER since setting $PAGER works\nalso, and not specific to --paginate since many commands enable it\nautomatically).\n\n-- \nMatthieu\n"},{"id":"51003","messageId":"alpine.LFD.0.999.0708191051390.30176@woody.linux-foundation.org","threadId":"9574","inReplyTo":"vpq1wdz307k.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-08-19T17:52:58Z","receivedAt":"2007-08-19T17:52:58Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 19 Aug 2007, Matthieu Moy wrote:\n> \n> I think that deserves an less-hacky, and documented way. I'd suggest a\n> --no-pager, or --dont-paginate, that would do the opposite of -p as a\n> global option for git.\n\nAck. I think it makes sense. The GIT_PAGER thing is equivalent, but at the \nsame time, having a way to explicitly disable it with a command line \noption just seems to be the RightThing(tm) to do.\n\n\t\tLinus\n"},{"id":"51006","messageId":"819D2F58-960A-4DA4-8FAC-7DE69A78F971@silverinsanity.com","threadId":"9574","inReplyTo":"vpq1wdz307k.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-08-19T18:24:07Z","receivedAt":"2007-08-19T18:24:07Z","isPatch":false,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Aug 19, 2007, at 1:26 PM, Matthieu Moy wrote:\n\n> I think that deserves an less-hacky, and documented way. I'd suggest a\n> --no-pager, or --dont-paginate, that would do the opposite of -p as a\n> global option for git.\n\nACK.  I was going to write this pretty soon myself.\n\n~~ Brian\n"},{"id":"51008","messageId":"7vodh3bbmx.fsf@gitster.siamese.dyndns.org","threadId":"9574","inReplyTo":"vpq1wdz307k.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-19T18:52:06Z","receivedAt":"2007-08-19T18:52:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> I think that deserves an less-hacky, and documented way. I'd suggest a\n> --no-pager, or --dont-paginate, that would do the opposite of -p as a\n> global option for git.\n\nI think that is a good thing to do.\n\n> From 2148c2564ca6480feaec9a9d091259032257918d Mon Sep 17 00:00:00 2001\n> From: Matthieu Moy <Matthieu.Moy@imag.fr>\n> Date: Sun, 19 Aug 2007 19:24:36 +0200\n> Subject: [PATCH] Add and document a global --no-pager option for git.\n>\n> To keep the change small, this is done by setting GIT_PAGER to \"cat\". I'd\n> prefer not using global/environment variables for that, but it would\n> require a complete refactoring of options handling in git.\n\nAnd I do not necessarily think this GIT_PAGER thing is a bad way\nto do so either.  It may end up spawning other commands (perhaps\nvia alias) and the use of environment is probably the way with\nthe least impact and complexity.\n\nPlease resend an applyable patch with a sign-off (and acked-by\nas you have seen).\n"},{"id":"51013","messageId":"vpq643bz4vx.fsf@bauges.imag.fr","threadId":"9574","inReplyTo":"7vodh3bbmx.fsf@gitster.siamese.dyndns.org","subject":"Re: [RFC] Clean way to disable pager","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-19T19:44:02Z","receivedAt":"2007-08-19T19:44:02Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Please resend an applyable patch with a sign-off (and acked-by\n> as you have seen).\n\n>From 2c79b9a1b446ca9fa9d72fc595120da34fd403dd Mon Sep 17 00:00:00 2001\nFrom: Matthieu Moy <Matthieu.Moy@imag.fr>\nDate: Sun, 19 Aug 2007 19:24:36 +0200\nSubject: [PATCH] Add and document a global --no-pager option for git.\n\nTo keep the change small, this is done by setting GIT_PAGER to \"cat\".\n\nAcked-by: Linus Torvalds <torvalds@linux-foundation.org>\nAcked-by: Brian Gernhardt <benji@silverinsanity.com>\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git.txt |    6 +++++-\n git.c                 |    6 +++++-\n 2 files changed, 10 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 8017997..707a756 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -9,7 +9,8 @@ git - the stupid content tracker\n SYNOPSIS\n --------\n [verse]\n-'git' [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate]\n+'git' [--version] [--exec-path[=GIT_EXEC_PATH]] \n+    [-p|--paginate] [--no-pager]\n     [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n     [--help] COMMAND [ARGS]\n \n@@ -103,6 +104,9 @@ OPTIONS\n -p|--paginate::\n        Pipe all output into 'less' (or if set, $PAGER).\n \n+--no-pager::\n+       Do not pipe git output into a pager.\n+\n --git-dir=<path>::\n        Set the path to the repository. This can also be controlled by\n        setting the GIT_DIR environment variable.\ndiff --git a/git.c b/git.c\nindex cab0e72..f280e7d 100644\n--- a/git.c\n+++ b/git.c\n@@ -4,7 +4,7 @@\n #include \"quote.h\"\n \n const char git_usage_string[] =\n-       \"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]\";\n+       \"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate] [--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND \n[ARGS]\";                                                                                                                                                     \n \n static void prepend_to_path(const char *dir, int len)\n {\n@@ -58,6 +58,10 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)\n                        }\n                } else if (!strcmp(cmd, \"-p\") || !strcmp(cmd, \"--paginate\")) {\n                        setup_pager();\n+               } else if (!strcmp(cmd, \"--no-pager\")) {\n+                       setenv(\"GIT_PAGER\", \"cat\", 1);\n+                       if (envchanged)\n+                               *envchanged = 1;\n                } else if (!strcmp(cmd, \"--git-dir\")) {\n                        if (*argc < 2) {\n                                fprintf(stderr, \"No directory given for --git-dir.\\n\" );\n-- \n1.5.3.rc0.64.gf4f4a-dirty\n\n\n\n-- \nMatthieu\n"},{"id":"51023","messageId":"20070819212827.GA5442@steel.home","threadId":"9574","inReplyTo":"vpq1wdz307k.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-08-19T21:28:27Z","receivedAt":"2007-08-19T21:28:27Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Matthieu Moy, Sun, Aug 19, 2007 19:26:07 +0200:\n> I think that deserves an less-hacky, and documented way. I'd suggest a\n> --no-pager, or --dont-paginate, that would do the opposite of -p as a\n> global option for git.\n\nAck.\n\nBesides, some platforms having no way to unset an environment\nvariable, a really cumbersome to work with them (Cygwin/Win32, yes),\nso this switch is actually the only way to achive something stable.\n"},{"id":"51026","messageId":"325563A3-050A-4830-9ACB-9ED15322F038@apple.com","threadId":"9574","inReplyTo":"vpq643bz4vx.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Adam Roben","fromEmail":"aroben@apple.com","sentAt":"2007-08-19T21:59:16Z","receivedAt":"2007-08-19T21:59:16Z","isPatch":false,"sender":{"key":"aroben@apple.com","avatar":"https://gravatar.com/avatar/9d3697e1de53890adf241331f4b970bdd2b18962b2ff0b8028ebb00e085807f8?d=mp&s=160"},"body":"\nOn Aug 19, 2007, at 12:44 PM, Matthieu Moy wrote:\n\n> +    [-p|--paginate] [--no-pager]\n\n   I think that [-p|--[no-]paginate] would be more consistent with the  \nway negatable options are normally specified.\n\n-Adam\n"},{"id":"51028","messageId":"85ps1jp2w9.fsf@lola.goethe.zz","threadId":"9574","inReplyTo":"325563A3-050A-4830-9ACB-9ED15322F038@apple.com","subject":"Re: [RFC] Clean way to disable pager","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-19T22:37:10Z","receivedAt":"2007-08-19T22:37:10Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Adam Roben <aroben@apple.com> writes:\n\n> On Aug 19, 2007, at 12:44 PM, Matthieu Moy wrote:\n>\n>> +    [-p|--paginate] [--no-pager]\n>\n>   I think that [-p|--[no-]paginate] would be more consistent with the\n> way negatable options are normally specified.\n\nDisregard previously existing code, I'd vote for using an option set\nlike the following:\n\n--pager\n--pager=less\n--pager=cat\n--no-pager\n\n\"--paginate\" is rather artificial in contrast.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"51060","messageId":"vpqzm0mvcz0.fsf@bauges.imag.fr","threadId":"9574","inReplyTo":"85ps1jp2w9.fsf@lola.goethe.zz","subject":"Re: [RFC] Clean way to disable pager","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-20T08:15:15Z","receivedAt":"2007-08-20T08:15:15Z","isPatch":false,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"David Kastrup <dak@gnu.org> writes:\n\n> Adam Roben <aroben@apple.com> writes:\n>\n>> On Aug 19, 2007, at 12:44 PM, Matthieu Moy wrote:\n>>\n>>> +    [-p|--paginate] [--no-pager]\n>>\n>>   I think that [-p|--[no-]paginate] would be more consistent with the\n>> way negatable options are normally specified.\n>\n> Disregard previously existing code, I'd vote for using an option set\n> like the following:\n>\n> --pager\n> --pager=less\n> --pager=cat\n> --no-pager\n>\n> \"--paginate\" is rather artificial in contrast.\n\nACK. I thought of naming the option --no-paginate, but I don't think\nthat good english. --dont-paginate would be good english, but doesn't\nmatch the --[no-]whatever scheme.\n\nPerhaps using David's proposal, and keeping the --paginate as a\nbackward compatibility, deprecated switch is the way to go.\n\n-- \nMatthieu\n"},{"id":"51145","messageId":"fadhkv$amj$2@sea.gmane.org","threadId":"9574","inReplyTo":"vpqzm0mvcz0.fsf@bauges.imag.fr","subject":"Re: [RFC] Clean way to disable pager","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-08-21T02:11:46Z","receivedAt":"2007-08-21T02:11:46Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Matthieu Moy wrote:\n> David Kastrup <dak@gnu.org> writes:\n>> Adam Roben <aroben@apple.com> writes:\n>>> On Aug 19, 2007, at 12:44 PM, Matthieu Moy wrote:\n>>>\n>>>> +    [-p|--paginate] [--no-pager]\n>>>\n>>>   I think that [-p|--[no-]paginate] would be more consistent with the\n>>> way negatable options are normally specified.\n>>\n>> Disregard previously existing code, I'd vote for using an option set\n>> like the following:\n>>\n>> --pager\n>> --pager=less\n>> --pager=cat\n>> --no-pager\n>>\n>> \"--paginate\" is rather artificial in contrast.\n> \n> ACK. I thought of naming the option --no-paginate, but I don't think\n> that good english. --dont-paginate would be good english, but doesn't\n> match the --[no-]whatever scheme.\n> \n> Perhaps using David's proposal, and keeping the --paginate as a\n> backward compatibility, deprecated switch is the way to go.\n\nI like it too. ACK.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"51155","messageId":"11876854283229-git-send-email-Matthieu.Moy@imag.fr","threadId":"9574","inReplyTo":"fadhkv$amj$2@sea.gmane.org","subject":"[PATCH] Replace git --paginate by git --pager[=PAGER_CMD].","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-21T08:37:08Z","receivedAt":"2007-08-21T08:37:08Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"The previous one was -p|--paginate, but doesn't accept a natural\nnegation. This patch changes it to -p|--pager|--pager=PAGER_CMD, which\nmakes the negation --no-pager more natural, and provides a simple way to\noverride the pager command (git --pager=CMD is equivalent to\nGIT_PAGER=CMD git with most shells).\n\n--paginate is kept as a backward-compatibility, deprecated option.\n\nSuggested-by: David Kastrup <dak@gnu.org>\nIdea-acked-by: Jakub Narebski <jnareb@gmail.com>\n\nSigned-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n---\n Documentation/git.txt |    8 +++++---\n git.c                 |   16 ++++++++++++++--\n 2 files changed, 19 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex 3b0d530..444823d 100644\n--- a/Documentation/git.txt\n+++ b/Documentation/git.txt\n@@ -10,7 +10,7 @@ SYNOPSIS\n --------\n [verse]\n 'git' [--version] [--exec-path[=GIT_EXEC_PATH]]\n-    [-p|--paginate|--no-pager]\n+    [-p|--pager[=PAGER_CMD]|--no-pager]\n     [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]\n     [--help] COMMAND [ARGS]\n \n@@ -101,8 +101,10 @@ OPTIONS\n \tenvironment variable. If no path is given 'git' will print\n \tthe current setting and then exit.\n \n--p|--paginate::\n-\tPipe all output into 'less' (or if set, $PAGER).\n+-p|--pager[=PAGER_CMD]::\n+\tPipe all output into 'less' (or if set, PAGER_CMD,\n+\t`$GIT_PAGER`, or `$PAGER`, in this order of preference).\n+\t--paginate is provided as a deprecated alias for -p.\n \n --no-pager::\n \tDo not pipe git output into a pager.\ndiff --git a/git.c b/git.c\nindex c46691e..4c626b5 100644\n--- a/git.c\n+++ b/git.c\n@@ -4,7 +4,9 @@\n #include \"quote.h\"\n \n const char git_usage_string[] =\n-\t\"git [--version] [--exec-path[=GIT_EXEC_PATH]] [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]\";\n+\t\"git [--version] [--exec-path[=GIT_EXEC_PATH]]\\n\"\n+        \"\t[-p|--pager[=PAGER_CMD]|--no-pager] [--bare]\\n\"\n+        \"\t[--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]\";\n \n static void prepend_to_path(const char *dir, int len)\n {\n@@ -56,8 +58,18 @@ static int handle_options(const char*** argv, int* argc, int* envchanged)\n \t\t\t\tputs(git_exec_path());\n \t\t\t\texit(0);\n \t\t\t}\n-\t\t} else if (!strcmp(cmd, \"-p\") || !strcmp(cmd, \"--paginate\")) {\n+\t\t} else if (!strcmp(cmd, \"-p\") || \n+                           /* \n+                            * Deprecated, but kept for backward\n+                            * compatibility\n+                            */\n+                           !strcmp(cmd, \"--paginate\")) {\n \t\t\tsetup_pager();\n+                } else if (!prefixcmp(cmd, \"--pager\")) {\n+\t\t\tcmd += 7;\n+\t\t\tif (*cmd == '=')\n+\t\t\t\tsetenv(\"GIT_PAGER\", cmd+1, 1);\n+                        setup_pager();\n \t\t} else if (!strcmp(cmd, \"--no-pager\")) {\n \t\t\tsetenv(\"GIT_PAGER\", \"cat\", 1);\n \t\t\tif (envchanged)\n-- \n1.5.3.rc5.17.g1cd0d-dirty\n"},{"id":"51156","messageId":"Pine.LNX.4.64.0708211041170.16728@wbgn129.biozentrum.uni-wuerzburg.de","threadId":"9574","inReplyTo":"11876854283229-git-send-email-Matthieu.Moy@imag.fr","subject":"Re: [PATCH] Replace git --paginate by git --pager[=PAGER_CMD].","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-08-21T08:42:21Z","receivedAt":"2007-08-21T08:42:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 21 Aug 2007, Matthieu Moy wrote:\n\n> The previous one was -p|--paginate, but doesn't accept a natural\n> negation. This patch changes it to -p|--pager|--pager=PAGER_CMD, which\n> makes the negation --no-pager more natural, and provides a simple way to\n> override the pager command (git --pager=CMD is equivalent to\n> GIT_PAGER=CMD git with most shells).\n> \n> --paginate is kept as a backward-compatibility, deprecated option.\n\nPersonally, I like to read \"git --paginate log\" better than to read \"git \n--pager log\".  So I would not unnecessarily deprecate --paginate.  It's \nnot like it hurts or something.\n\nCiao,\nDscho\n"},{"id":"51157","messageId":"vpqtzqte0dp.fsf@bauges.imag.fr","threadId":"9574","inReplyTo":"Pine.LNX.4.64.0708211041170.16728@wbgn129.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Replace git --paginate by git --pager[=PAGER_CMD].","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@imag.fr","sentAt":"2007-08-21T08:51:30Z","receivedAt":"2007-08-21T08:51:30Z","isPatch":true,"sender":{"key":"git@matthieu-moy.fr","avatar":"https://avatars.githubusercontent.com/u/14709?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Personally, I like to read \"git --paginate log\" better than to read \"git \n> --pager log\".  So I would not unnecessarily deprecate --paginate.  It's \n> not like it hurts or something.\n\nIt doesn't \"hurt\", but having several options to do the same thing is\nuseless and confusing (someone reading here about --paginate and there\nabout --pager may not immediately notice that one is an alias for the\nother).\n\nAnyway, how often do you type or read \"git --paginate log\"?\n\n-- \nMatthieu\n"},{"id":"51158","messageId":"868x85gs8b.fsf@lola.quinscape.zz","threadId":"9574","inReplyTo":"vpqtzqte0dp.fsf@bauges.imag.fr","subject":"Re: [PATCH] Replace git --paginate by git --pager[=PAGER_CMD].","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-21T09:19:16Z","receivedAt":"2007-08-21T09:19:16Z","isPatch":true,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Matthieu Moy <Matthieu.Moy@imag.fr> writes:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n>\n>> Personally, I like to read \"git --paginate log\" better than to read \"git \n>> --pager log\".  So I would not unnecessarily deprecate --paginate.  It's \n>> not like it hurts or something.\n>\n> It doesn't \"hurt\", but having several options to do the same thing is\n> useless and confusing (someone reading here about --paginate and there\n> about --pager may not immediately notice that one is an alias for the\n> other).\n>\n> Anyway, how often do you type or read \"git --paginate log\"?\n\nSince it is the default anyway...\n\nMaybe one should have a way to tell git \"don't use a pager by default,\nbut _if_ someone says --pager, _then_ use the following pager\".\n\nIf one has to set the pager to \"cat\" to disable paging, using --pager\nwill not exactly be impressive.\n\nSo maybe --no-pager/--pager (or an equivalent config file setting)\nshould not tamper with the setting of GIT_PAGER, but rather set/reset\nan independent flag.\n\n-- \nDavid Kastrup\n"}]}