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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simon Ruderich <simon@xxxxxxxxxxxx> writes:

> 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@xxxxxxxxxxxx>

Thanks, but is it true that interactive.singlekey "requries"
Term::ReadKey?

The relevant part of git-add--interactive reads like so:

if ($repo->config_bool("interactive.singlekey")) {
	eval {
		require Term::ReadKey;
		Term::ReadKey->import;
		$use_readkey = 1;
	};
	eval {
		require Term::Cap;
		my $termcap = Term::Cap->Tgetent;
		foreach (values %$termcap) {
			$term_escapes{$_} = 1 if /^\e/;
		}
		$use_termcap = 1;
	};
}

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?

You also misspelled the package name it seems ;-)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]