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

Re: [PATCH v2] git-config: document interactive.singlekey requires Term::ReadKey

From
Simon Ruderich <simon@ruderich.org>
Date
Mar 3, 2014, 21:15 UTC
Message-ID
<20140303211549.GA24857@ruderich.org>
In-Reply-To
<xmqq1tyjqfbh.fsf@gitster.dls.corp.google.com>

Most distributions don't require Term::ReadKey as dependency, leaving the user to wonder why the setting doesn't work.

Signed-off-by: Simon Ruderich <simon@ruderich.org>
---
On Mon, Mar 03, 2014 at 10:58:58AM -0800, Junio C Hamano wrote:
> Thanks, but is it true that interactive.singlekey "requries"
> Term::ReadKey?

Yes, it requires it. The code also works fine without Term::ReadKey, but the feature "singlekey" requires this module. I assumed a user enabling this option would also want to use the feature, therefore "requires" is fine IMHO.

Show 10 quoted lines
> The implementation of prompt_single_character sub wants to use
> ReadKey, but can still let the user interact with the program by
> falling back to a cooked input when it is not available, so perhaps
> a better fix might be something like this:
>
>         if (!$use_readkey) {
>         	print STDERR "missing Term::ReadKey, disabling interactive.singlekey\n";
>         }
>
> inside the above if() that prepares $use_readkey?
Good idea. Implemented in an additional patch.

I think the documentation should also be updated (this patch) to make it clear to a reader of the man page, that an additional module is required, without having him to try to use the option.

> You also misspelled the package name it seems ;-)
Oops, sorry. Fixed in this reroll.

Regards Simon

 Documentation/config.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5f4d793..406a582 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1633,7 +1633,7 @@ interactive.singlekey::
 	linkgit:git-add[1], linkgit:git-checkout[1], linkgit:git-commit[1],
 	linkgit:git-reset[1], and linkgit:git-stash[1]. Note that this
 	setting is silently ignored if portable keystroke input
-	is not available.
+	is not available; requires the Perl module Term::ReadKey.
 
 log.abbrevCommit::
 	If true, makes linkgit:git-log[1], linkgit:git-show[1], and
-- 
1.9.0.11.g9a08b42

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
Previous: Junio C HamanoNext: Simon Ruderich
Message 3 of 4 in “git-config: document interactive.singlekey requires Term::Readkey”
  1. git-config: document interactive.singlekey requires Term::ReadkeySimon Ruderich, Mar 2, 2014
  2. Junio C HamanoMar 3, 2014
  3. Simon RuderichMar 3, 2014
  4. git-add--interactive: warn if module for interactive.singlekey is missingSimon Ruderich, Mar 3, 2014

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.