git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git: add -N as a short option for --no-pager

From
Johannes Sixt <j6t@kdbg.org>
Date
Apr 25, 2018, 06:25 UTC
Message-ID
<08882cea-5dab-3cc7-33ac-cf938253a34a@kdbg.org>
In-Reply-To
<xmqqh8o05evv.fsf@gitster-ct.c.googlers.com>
Am 25.04.2018 um 02:05 schrieb Junio C Hamano:
Show 22 quoted lines
> Johannes Sixt <j6t@kdbg.org> writes:
>> It is not uncommon to request that the output remains visible in
>> the terminal. For this, the option --no-pager can be used. But
>> it is a bit cumbersome to type, even when command completion is
>> available. Provide a short option, -N, to make the option easier
>> accessible.
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>> ---
> 
> Heh, I used to append "|cat", which is four keystrokes that is a bit
> shorter than " --no-pager", but that is only acceptable when you do
> not care about colored output ;-)
> 
> I am not absolutely certain about the choice of a single letter. I
> already checked we do not use "git -N cmd" for anything else right
> now, so I am certain about the availability, but I am not sure if
> capital 'N' is the best choice, when the other side is lowercase 'p'
> (and more importantly, the other side 'p' has mneomonic value for
> 'pagination', but 'N' merely stands for 'no' and could be negating
> anything, not related to pagination). But I agree that a short-hand
> would be welcome.

I considered -P, but thought that it would better be reserved for something related to "paths". We have --{html,man,info}-path, which would be served better with -[HMI]. That leaves --exec-path, which we would probably abbreviate as -x or -X. So, -P is perhaps not that bad after all.

We could also choose +p, for which there is some precedent in other POSIX tools to mean negated -p, but not in git, I think. Implementationwise, it is not that trivial, either, because the section handling options is guarded by a check that the word begins with a dash.

Perhaps --no-pager means also "unpaginated" (-u, -U), "linear" (-l, -L), "streamed" (-s, -S). Other ideas, anyone?

Show 14 quoted lines
> 
>> diff --git a/Documentation/git.txt b/Documentation/git.txt
>> index 4767860e72..17b50b0dc6 100644
>> --- a/Documentation/git.txt
>> +++ b/Documentation/git.txt
>> @@ -11,7 +11,7 @@ SYNOPSIS
>>   [verse]
>>   'git' [--version] [--help] [-C <path>] [-c <name>=<value>]
>>       [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
>> -    [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
>> +    [-p|--paginate|-N|--no-pager] [--no-replace-objects] [--bare]
>>       [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
>>       [--super-prefix=<path>]
>>       <command> [<args>]
Previous: Beat Bolli <bbolli@ewanet.ch>Next: Johannes Schindelin
Message 4 of 14 in “git: add -N as a short option for --no-pager”
  1. git: add -N as a short option for --no-pagerJohannes Sixt, Apr 24, 2018
  2. Junio C HamanoApr 25, 2018
  3. Beat Bolli <bbolli@ewanet.ch>Apr 25, 2018
  4. Johannes SixtApr 25, 2018
  5. Johannes SchindelinApr 25, 2018
  6. Johannes SixtApr 25, 2018
  7. Kaartic SivaraamMay 1, 2018
  8. Phillip WoodApr 25, 2018
  9. Johannes SixtApr 25, 2018
  10. Kaartic SivaraamMay 1, 2018
  11. git: add -P as a short option for --no-pagerJohannes Sixt, May 3, 2018
  12. Eric SunshineMay 3, 2018
  13. Junio C HamanoMay 4, 2018
  14. Johannes SchindelinDec 21, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.