Skip to content

Commit c9aac55

Browse files
committed
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
2 parents 4a3bf32 + 7213c28 commit c9aac55

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Documentation/git.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ SYNOPSIS
1111
[verse]
1212
'git' [--version] [--help] [-C <path>] [-c <name>=<value>]
1313
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
14-
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
14+
[-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare]
1515
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
1616
[--super-prefix=<path>]
1717
<command> [<args>]
@@ -103,6 +103,7 @@ foo.bar= ...`) sets `foo.bar` to the empty string which `git config
103103
configuration options (see the "Configuration Mechanism" section
104104
below).
105105

106+
-P::
106107
--no-pager::
107108
Do not pipe Git output into a pager.
108109

git.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct cmd_struct {
2525
const char git_usage_string[] =
2626
N_("git [--version] [--help] [-C <path>] [-c <name>=<value>]\n"
2727
" [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n"
28-
" [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]\n"
28+
" [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]\n"
2929
" [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\n"
3030
" <command> [<args>]");
3131

@@ -99,7 +99,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)
9999
exit(0);
100100
} else if (!strcmp(cmd, "-p") || !strcmp(cmd, "--paginate")) {
101101
use_pager = 1;
102-
} else if (!strcmp(cmd, "--no-pager")) {
102+
} else if (!strcmp(cmd, "-P") || !strcmp(cmd, "--no-pager")) {
103103
use_pager = 0;
104104
if (envchanged)
105105
*envchanged = 1;

0 commit comments

Comments
 (0)