Re: [PATCH 4/7] refactor git_getpass into generic prompt function
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 9, 2011, 23:58 UTC
- Message-ID
- <7vzkf1b8mp.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20111208083133.GD26409@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 13 quoted lines
> 2. The first series had a special "name" parameter just for generating > error messages. This drops it in the name of simplicity, so error > messages have gone from (assuming you don't have a tty): > > Could not read password: No such device or address > > to: > > Could not read 'Username for 'https://example.com': ': No such > device or address > > which is verbose, yes, but contains a little more useful > information. The formatting is rather unfortunate,...
It also would be unpleasant to i18n it, I suspect.
> + r = getpass(prompt);
> + if (!r)
> + die_errno("could not read '%s'", prompt);Taking advantage of the "prompt-string"-ness of the message, this might be a cuter workaround:
fatal: Password: <<could not be read>>
But I do not think it matters that much. Let's queue what you have, and work out these details in-tree.