{"thread":{"id":"29171","subject":"[PATCH] Add '-P' as a synonym for '--no-pager' in the git command","startedAt":"2011-12-15T20:55:41Z","lastAt":"2011-12-16T09:30:09Z","messageCount":3,"participants":["Joe Ratterman","Junio C Hamano","Matthieu Moy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"181249","messageId":"1323982541-18995-1-git-send-email-jratt0@gmail.com","threadId":"29171","inReplyTo":null,"subject":"[PATCH] Add '-P' as a synonym for '--no-pager' in the git command","fromName":"Joe Ratterman","fromEmail":"jratt0@gmail.com","sentAt":"2011-12-15T20:55:41Z","receivedAt":"2011-12-15T20:55:41Z","isPatch":true,"sender":{"key":"jratt0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/66082737?v=4"},"body":"  Also, add both -P|--no-pager to the existing -p|--paginate in bash\n  completion.\n\nSigned-off-by: Joe Ratterman <jratt0@gmail.com>\n---\n Documentation/git.txt                  |    3 ++-\n contrib/completion/git-completion.bash |    2 +-\n git.c                                  |    4 ++--\n t/t7006-pager.sh                       |    8 ++++++++\n 4 files changed, 13 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git.txt b/Documentation/git.txt\nindex e869032..c7f8445 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[=<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=<path>] [--work-tree=<path>] [--namespace=<name>]\n     [-c <name>=<value>]\n     [--help] <command> [<args>]\n@@ -329,6 +329,7 @@ help ...`.\n \tconfiguration options (see the \"Configuration Mechanism\" section\n \tbelow).\n \n+-P::\n --no-pager::\n \tDo not pipe git output into a pager.\n \ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex cc1bdf9..8b9ea1b 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -2640,7 +2640,7 @@ _git ()\n \t\tcase \"$i\" in\n \t\t--git-dir=*) __git_dir=\"${i#--git-dir=}\" ;;\n \t\t--bare)      __git_dir=\".\" ;;\n-\t\t--version|-p|--paginate) ;;\n+\t\t--version|-p|--paginate|-P|--no-pager) ;;\n \t\t--help) command=\"help\"; break ;;\n \t\t*) command=\"$i\"; break ;;\n \t\tesac\ndiff --git a/git.c b/git.c\nindex 8e34903..baa1613 100644\n--- a/git.c\n+++ b/git.c\n@@ -7,7 +7,7 @@\n \n const char git_usage_string[] =\n \t\"git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\\n\"\n-\t\"           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]\\n\"\n+\t\"           [-p|--paginate|-P|--no-pager] [--no-replace-objects] [--bare]\\n\"\n \t\"           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]\\n\"\n \t\"           [-c name=value] [--help]\\n\"\n \t\"           <command> [<args>]\";\n@@ -103,7 +103,7 @@ static int handle_options(const char ***argv, int *argc, int *envchanged)\n \t\t\texit(0);\n \t\t} else if (!strcmp(cmd, \"-p\") || !strcmp(cmd, \"--paginate\")) {\n \t\t\tuse_pager = 1;\n-\t\t} else if (!strcmp(cmd, \"--no-pager\")) {\n+\t\t} else if (!strcmp(cmd, \"-P\") || !strcmp(cmd, \"--no-pager\")) {\n \t\t\tuse_pager = 0;\n \t\t\tif (envchanged)\n \t\t\t\t*envchanged = 1;\ndiff --git a/t/t7006-pager.sh b/t/t7006-pager.sh\nindex 320e1d1..783915e 100755\n--- a/t/t7006-pager.sh\n+++ b/t/t7006-pager.sh\n@@ -84,6 +84,14 @@ test_expect_success 'no pager even with --paginate when stdout is a pipe' '\n \t! test -e paginated.out\n '\n \n+test_expect_success TTY 'no pager with -P' '\n+\trm -f paginated.out ||\n+\tcleanup_fail &&\n+\n+\ttest_terminal git -P log &&\n+\t! test -e paginated.out\n+'\n+\n test_expect_success TTY 'no pager with --no-pager' '\n \trm -f paginated.out ||\n \tcleanup_fail &&\n-- \n1.7.7.1\n"},{"id":"181259","messageId":"7vhb11ms1a.fsf@alter.siamese.dyndns.org","threadId":"29171","inReplyTo":"1323982541-18995-1-git-send-email-jratt0@gmail.com","subject":"Re: [PATCH] Add '-P' as a synonym for '--no-pager' in the git command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-12-15T21:41:37Z","receivedAt":"2011-12-15T21:41:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sorry, but why was I listed on the To: line?\n\nI do not recall there was a list concensus that this is a must-have or\neven good-to-have, and I am not personally interested in this. I hesitate\nto accept a patch that lets a feature without clear advantage squat on a\nshort-and-sweet single-letter option, generally speaking.\n"},{"id":"181285","messageId":"vpqliqc50f2.fsf@bauges.imag.fr","threadId":"29171","inReplyTo":"1323982541-18995-1-git-send-email-jratt0@gmail.com","subject":"Re: [PATCH] Add '-P' as a synonym for '--no-pager' in the git command","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-12-16T09:30:09Z","receivedAt":"2011-12-16T09:30:09Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Joe Ratterman <jratt0@gmail.com> writes:\n\n>   Also, add both -P|--no-pager to the existing -p|--paginate in bash\n>   completion.\n\nA good commit message should always answer the question \"why?\". In this\ncase, I really don't see why this is needed. If you don't like Git's\nauto-paginate feature, turn it off with core.pager or pager.<cmd>. If\nyou like it, you very rarely need --no-pager (IIRC, I'm the one who\nintroduced --no-pager, and I don't think I've ever used it outside a\nscript).\n\nSo, I'd rather keep -P free in case we need it later for something\nreally useful (or possibly a better commit message).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}