Add core.pager config variable.
This adds a configuration variable that performs the same function as, but is overridden by, GIT_PAGER. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Acked-by: Johannes E. Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brian Gernhardt committed
Jul 3, 2007 at 14:18 UTC
54adf3706c5c799584c1bcdcac96fb3285b97de4
5 files changed
+13
Documentation/config.txt
+4
@@ -281,6 +281,10 @@ core.excludesfile::
281
of files which are not meant to be tracked. See
282
gitlink:gitignore[5].
283
284
+core.pager::
285
+ The command that git will use to paginate output. Can be overridden
286
+ with the `GIT_PAGER` environment variable.
287
+
288
alias.*::
289
Command aliases for the gitlink:git[1] command wrapper - e.g.
290
after defining "alias.last = cat-file commit HEAD", the invocation
cache.h
+1
@@ -546,6 +546,7 @@ extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char
546
547
/* pager.c */
548
extern void setup_pager(void);
549
+extern char *pager_program;
550
extern int pager_in_use;
551
extern int pager_use_color;
552
config.c
+5
@@ -387,6 +387,11 @@ int git_default_config(const char *var, const char *value)
387
return 0;
388
}
389
390
+ if (!strcmp(var, "core.pager")) {
391
+ pager_program = xstrdup(value);
392
+ return 0;
393
+ }
394
+
395
/* Add other config variables here and to Documentation/config.txt. */
396
return 0;
397
}
environment.c
+1
@@ -30,6 +30,7 @@ int core_compression_seen;
30
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
31
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
32
size_t delta_base_cache_limit = 16 * 1024 * 1024;
33
+char *pager_program;
34
int pager_in_use;
35
int pager_use_color = 1;
36
int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */
pager.c
+2
@@ -31,6 +31,8 @@ void setup_pager(void)
31
32
if (!isatty(1))
33
return;
34
+ if (!pager)
35
+ pager = pager_program;
36
if (!pager)
37
pager = getenv("PAGER");
38
if (!pager)