From: Junio C Hamano Date: Wed, 23 May 2018 05:38:18 +0000 (+0900) Subject: Merge branch 'js/no-pager-shorthand' X-Git-Tag: v2.18.0-rc0~51 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c9aac55c4e99302e1e365e480eb52c3da2d7c853?hp=4a3bf32b6c7e5d832e02f30a78ad23dc6ba15dcc Merge branch 'js/no-pager-shorthand' "git --no-pager cmd" did not have short-and-sweet single letter option. Now it does. * js/no-pager-shorthand: git: add -P as a short option for --no-pager --- diff --git a/Documentation/git.txt b/Documentation/git.txt index 4767860e72..c662f41c1d 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git' [--version] [--help] [-C ] [-c =] [--exec-path[=]] [--html-path] [--man-path] [--info-path] - [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] + [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare] [--git-dir=] [--work-tree=] [--namespace=] [--super-prefix=] [] @@ -103,6 +103,7 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config configuration options (see the "Configuration Mechanism" section below). +-P:: --no-pager:: Do not pipe Git output into a pager. diff --git a/git.c b/git.c index bab6bbfded..5771d62a32 100644 --- a/git.c +++ b/git.c @@ -25,7 +25,7 @@ struct cmd_struct { const char git_usage_string[] = N_("git [--version] [--help] [-C ] [-c =]\n" " [--exec-path[=]] [--html-path] [--man-path] [--info-path]\n" - " [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n" + " [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n" " [--git-dir=] [--work-tree=] [--namespace=]\n" " []"); @@ -99,7 +99,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged) exit(0); } else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) { use_pager = 1; - } else if (!strcmp(cmd, "--no-pager")) { + } else if (!strcmp(cmd, "-P") || !strcmp(cmd, "--no-pager")) { use_pager = 0; if (envchanged) *envchanged = 1;