{"thread":{"id":"8837","subject":"[PATCH] Add pager.program config variable.","startedAt":"2007-07-03T16:03:08Z","lastAt":"2007-07-04T05:10:45Z","messageCount":8,"participants":["Brian Gernhardt","Johannes Schindelin","Robin Rosenberg","Jonas Fonseca","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46382","messageId":"20070703160308.GA16629@Hermes.local","threadId":"8837","inReplyTo":null,"subject":"[PATCH] Add pager.program config variable.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-07-03T16:03:08Z","receivedAt":"2007-07-03T16:03:08Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"This adds a configuration variable that performs the same function as,\nbut is overridden by, GIT_PAGER.\n\nSigned-off-by: Brian Gernhardt <benji@silverinsanity.com>\n---\n\n This takes the last bit of git specific configuration out of my\n .profile and puts it in .gitconfig where it belongs.\n\n I didn't know what name to use.  I settled on pager.program, but\n thought that core.pager might be better since there are no other\n options in the pager section.\n\n Documentation/config.txt |    4 ++++\n cache.h                  |    1 +\n config.c                 |    5 +++++\n environment.c            |    1 +\n pager.c                  |    2 ++\n 5 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 1d96adf..1c4f3d5 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -596,6 +596,10 @@ pack.deltaCacheLimit::\n \tThe maxium size of a delta, that is cached in\n \tgitlink:git-pack-objects[1]. Defaults to 1000.\n \n+pager.program::\n+\tThe command that git will use to page output.  Can be overridden with\n+\tthe `GIT_PAGER` environment variable.\n+\n pull.octopus::\n \tThe default merge strategy to use when pulling multiple branches\n \tat once.\ndiff --git a/cache.h b/cache.h\nindex 0d23a25..e64071e 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -546,6 +546,7 @@ extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char\n \n /* pager.c */\n extern void setup_pager(void);\n+extern char *pager_program;\n extern int pager_in_use;\n extern int pager_use_color;\n \ndiff --git a/config.c b/config.c\nindex 4de8926..146b4bd 100644\n--- a/config.c\n+++ b/config.c\n@@ -387,6 +387,11 @@ int git_default_config(const char *var, const char *value)\n \t\treturn 0;\n \t}\n \n+\tif (!strcmp(var, \"pager.program\")) {\n+\t\tpager_program = xstrdup(value);\n+\t\treturn 0;\n+\t}\n+\n \t/* Add other config variables here and to Documentation/config.txt. */\n \treturn 0;\n }\ndiff --git a/environment.c b/environment.c\nindex 1c2773f..f83fb9e 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -30,6 +30,7 @@ int core_compression_seen;\n size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;\n size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;\n size_t delta_base_cache_limit = 16 * 1024 * 1024;\n+char *pager_program;\n int pager_in_use;\n int pager_use_color = 1;\n int auto_crlf = 0;\t/* 1: both ways, -1: only when adding git objects */\ndiff --git a/pager.c b/pager.c\nindex 5f280ab..3bfed02 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -32,6 +32,8 @@ void setup_pager(void)\n \tif (!isatty(1))\n \t\treturn;\n \tif (!pager)\n+\t\tpager = pager_program;\n+\tif (!pager)\n \t\tpager = getenv(\"PAGER\");\n \tif (!pager)\n \t\tpager = \"less\";\n-- \n1.5.3.rc0\n"},{"id":"46387","messageId":"Pine.LNX.4.64.0707031729370.4071@racer.site","threadId":"8837","inReplyTo":"20070703160308.GA16629@Hermes.local","subject":"Re: [PATCH] Add pager.program config variable.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-03T16:30:00Z","receivedAt":"2007-07-03T16:30:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Jul 2007, Brian Gernhardt wrote:\n\n>  I didn't know what name to use.  I settled on pager.program, but\n>  thought that core.pager might be better since there are no other\n>  options in the pager section.\n\nYeah, core.pager seems more consistent.\n\nCiao,\nDscho\n"},{"id":"46391","messageId":"20070703181811.GA17966@Hermes.local","threadId":"8837","inReplyTo":"Pine.LNX.4.64.0707031729370.4071@racer.site","subject":"[PATCH] Add core.pager config variable.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-07-03T18:18:11Z","receivedAt":"2007-07-03T18:18:11Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"This adds a configuration variable that performs the same function as,\nbut is overridden by, GIT_PAGER.\n\nSigned-off-by: Brian Gernhardt <benji@silverinsanity.com>\n---\n\n Since Johannes agrees, core.pager it is.  :-)\n\n Documentation/config.txt |    4 ++++\n cache.h                  |    1 +\n config.c                 |    5 +++++\n environment.c            |    1 +\n pager.c                  |    2 ++\n 5 files changed, 13 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 1d96adf..d319359 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -281,6 +281,10 @@ core.excludesfile::\n \tof files which are not meant to be tracked.  See\n \tgitlink:gitignore[5].\n \n+core.pager::\n+\tThe command that git will use to paginatee output.  Can be overridden\n+\twith the `GIT_PAGER` environment variable.\n+\n alias.*::\n \tCommand aliases for the gitlink:git[1] command wrapper - e.g.\n \tafter defining \"alias.last = cat-file commit HEAD\", the invocation\ndiff --git a/cache.h b/cache.h\nindex 0d23a25..e64071e 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -546,6 +546,7 @@ extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char\n \n /* pager.c */\n extern void setup_pager(void);\n+extern char *pager_program;\n extern int pager_in_use;\n extern int pager_use_color;\n \ndiff --git a/config.c b/config.c\nindex 4de8926..561ee3b 100644\n--- a/config.c\n+++ b/config.c\n@@ -387,6 +387,11 @@ int git_default_config(const char *var, const char *value)\n \t\treturn 0;\n \t}\n \n+\tif (!strcmp(var, \"core.pager\")) {\n+\t\tpager_program = xstrdup(value);\n+\t\treturn 0;\n+\t}\n+\n \t/* Add other config variables here and to Documentation/config.txt. */\n \treturn 0;\n }\ndiff --git a/environment.c b/environment.c\nindex 1c2773f..f83fb9e 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -30,6 +30,7 @@ int core_compression_seen;\n size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;\n size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;\n size_t delta_base_cache_limit = 16 * 1024 * 1024;\n+char *pager_program;\n int pager_in_use;\n int pager_use_color = 1;\n int auto_crlf = 0;\t/* 1: both ways, -1: only when adding git objects */\ndiff --git a/pager.c b/pager.c\nindex 5f280ab..3bfed02 100644\n--- a/pager.c\n+++ b/pager.c\n@@ -32,6 +32,8 @@ void setup_pager(void)\n \tif (!isatty(1))\n \t\treturn;\n \tif (!pager)\n+\t\tpager = pager_program;\n+\tif (!pager)\n \t\tpager = getenv(\"PAGER\");\n \tif (!pager)\n \t\tpager = \"less\";\n-- \n1.5.3.rc0\n"},{"id":"46394","messageId":"Pine.LNX.4.64.0707031939040.4071@racer.site","threadId":"8837","inReplyTo":"20070703181811.GA17966@Hermes.local","subject":"Re: [PATCH] Add core.pager config variable.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-03T18:39:32Z","receivedAt":"2007-07-03T18:39:32Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 3 Jul 2007, Brian Gernhardt wrote:\n\n> This adds a configuration variable that performs the same function as,\n> but is overridden by, GIT_PAGER.\n> \n> Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>\n> ---\n> \n>  Since Johannes agrees, core.pager it is.  :-)\n\nAcked-by: Johannes E. Schindelin <johannes.schindelin@gmx.de>\n\nCiao,\nDscho\n"},{"id":"46399","messageId":"200707032142.07154.robin.rosenberg.lists@dewire.com","threadId":"8837","inReplyTo":"20070703181811.GA17966@Hermes.local","subject":"Re: [PATCH] Add core.pager config variable.","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-07-03T19:42:06Z","receivedAt":"2007-07-03T19:42:06Z","isPatch":true,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"tisdag 03 juli 2007 skrev Brian Gernhardt:\n> This adds a configuration variable that performs the same function as,\n> but is overridden by, GIT_PAGER.\n[...]\n> diff --git a/pager.c b/pager.c\n> index 5f280ab..3bfed02 100644\n> --- a/pager.c\n> +++ b/pager.c\n> @@ -32,6 +32,8 @@ void setup_pager(void)\n>  \tif (!isatty(1))\n>  \t\treturn;\n>  \tif (!pager)\n> +\t\tpager = pager_program;\n> +\tif (!pager)\n>  \t\tpager = getenv(\"PAGER\");\n>  \tif (!pager)\n>  \t\tpager = \"less\";\n\nNak.\n\nPAGER cannot override core.pager with this.\n\n-- robin\n"},{"id":"46401","messageId":"2c6b72b30707031248r7a3ccf8bw23bda41f2e2e117e@mail.gmail.com","threadId":"8837","inReplyTo":"20070703181811.GA17966@Hermes.local","subject":"Re: [PATCH] Add core.pager config variable.","fromName":"Jonas Fonseca","fromEmail":"jonas.fonseca@gmail.com","sentAt":"2007-07-03T19:48:18Z","receivedAt":"2007-07-03T19:48:18Z","isPatch":true,"sender":{"key":"jonas.fonseca@gmail.com","avatar":"https://gravatar.com/avatar/9b7fa23cce50269e5d164312b6ac5ae818a180f837b38f28f3bdf689dd7f96cd?d=mp&s=160"},"body":"On 7/3/07, Brian Gernhardt <benji@silverinsanity.com> wrote:\n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 1d96adf..d319359 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -281,6 +281,10 @@ core.excludesfile::\n>         of files which are not meant to be tracked.  See\n>         gitlink:gitignore[5].\n>\n> +core.pager::\n> +       The command that git will use to paginatee output.  Can be overridden\n> +       with the `GIT_PAGER` environment variable.\n> +\n\nA typo: paginatee.\n\n-- \nJonas Fonseca\n"},{"id":"46403","messageId":"5CF58212-5486-4BA6-AC78-50F62D1B7F6E@silverinsanity.com","threadId":"8837","inReplyTo":"200707032142.07154.robin.rosenberg.lists@dewire.com","subject":"Re: [PATCH] Add core.pager config variable.","fromName":"Brian Gernhardt","fromEmail":"benji@silverinsanity.com","sentAt":"2007-07-03T19:50:08Z","receivedAt":"2007-07-03T19:50:08Z","isPatch":true,"sender":{"key":"benji@silverinsanity.com","avatar":"https://gravatar.com/avatar/e06c101dbc25c68114d859b4a9ec7cf8a2c52fd2b0270ef0eac0e2e63ff22311?d=mp&s=160"},"body":"\nOn Jul 3, 2007, at 3:42 PM, Robin Rosenberg wrote:\n\n> Nak.\n>\n> PAGER cannot override core.pager with this.\n\ncore.pager is acting exactly like GIT_PAGER.  The priority goes (from  \npager.c:30):\n\nGIT_PAGER\ncore.pager\nPAGER\n\"less\"\n\nI think this is a desirable option because I'd like to tell all other  \nprograms to use less and tell git to use tig (which I'm trying out).   \nI specifically want core.pager to override PAGER, but this leaves  \nGIT_PAGER as the final override.  Why should I export an environment  \nvariable to every program when git has a configuration file?  And  \nwhat does overriding PAGER break?  If the user doesn't want to use  \ncore.pager, they don't have to.\n\n~~ Brian\n"},{"id":"46441","messageId":"7vtzskkb3e.fsf@assigned-by-dhcp.cox.net","threadId":"8837","inReplyTo":"20070703181811.GA17966@Hermes.local","subject":"Re: [PATCH] Add core.pager config variable.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-04T05:10:45Z","receivedAt":"2007-07-04T05:10:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Looks good, thanks.\n"}]}