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

Re: [PATCH] doc: note that interactive.singleKey is disabled by default

From
DSDragan Simic <dsimic@manjaro.org>
Date
May 22, 2024, 18:52 UTC
Message-ID
<54c318f42ce63f0575ea48f3dc1e8361@manjaro.org>
In-Reply-To
<xmqq34q966qq.fsf@gitster.g>
On 2024-05-22 20:28, Junio C Hamano wrote:
Show 24 quoted lines
> Dragan Simic <dsimic@manjaro.org> writes:
> 
>> diff --git a/Documentation/config/interactive.txt 
>> b/Documentation/config/interactive.txt
>> index 5cc26555f19a..067496d77cea 100644
>> --- a/Documentation/config/interactive.txt
>> +++ b/Documentation/config/interactive.txt
>> @@ -5,6 +5,7 @@ interactive.singleKey::
>>  	linkgit:git-add[1], linkgit:git-checkout[1],
>>  	linkgit:git-restore[1], linkgit:git-commit[1],
>>  	linkgit:git-reset[1], and linkgit:git-stash[1].
>> +	This is disabled by default.
> 
> Hmph, an optional configuration is optional because the lack of it
> means the feature behind it does not trigger.
> 
> While it makes tons of sense to mention what the default is when
> there are more than true or false choices (e.g. "defaults to never,
> among possible choices never/local/remote/always"), or if it
> defaults to true and the knob is to opt out of it, it feels like it
> adds unnecesary noise to say "defaults to off" for a configuration
> that is clearly a Boolean.
> 
> So I dunno.

Let's have a look at a rather suitable (and to me, a bit inspiring) excerpt from the git-config(1) man page:

   interactive.singleKey
      In interactive commands, allow the user to provide one-letter
      input with a single key (i.e., without hitting enter).
      Currently this is used by the --patch mode of git-add(1),
      git-checkout(1), git-restore(1), git-commit(1), git-reset(1),
      and git-stash(1). Note that this setting is silently ignored
      if portable keystroke input is not available; requires the
      Perl module Term::ReadKey.
   [...]
   log.abbrevCommit
      If true, makes git-log(1), git-show(1), and git-whatchanged(1)
      assume --abbrev-commit. You may override this option with
      --no-abbrev-commit.

With this in mind, I think that rewording the opening sentence for the description of interactive.singleKey like this would make sense:

   interactive.singleKey
      If true, allow the user to provide one-letter input with a
      single key (i.e., without hitting Enter key) in interactive
      commands.
      [...]

Thoughts? It would be more consistent and a bit more clear, without putting too much stress on the actual default value.

Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 6 in “doc: note that interactive.singleKey is disabled by default”
  1. doc: note that interactive.singleKey is disabled by defaultDragan Simic, May 22, 2024
  2. Rubén JustoMay 22, 2024
  3. Junio C HamanoMay 22, 2024
  4. Dragan SimicMay 22, 2024
  5. Junio C HamanoMay 22, 2024
  6. Dragan SimicMay 22, 2024

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.