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

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.

Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “[PATCHv2 0/7] getpass refactoring”
  1. Jeff KingDec 8, 2011
  2. 1/7 imap-send: avoid buffer overflowJeff King, Dec 8, 2011
  3. 2/7 imap-send: don't check return value of git_getpassJeff King, Dec 8, 2011
  4. 3/7 move git_getpass to its own source fileJeff King, Dec 8, 2011
  5. 4/7 refactor git_getpass into generic prompt functionJeff King, Dec 8, 2011
  6. Junio C HamanoDec 9, 2011
  7. 5/7 add generic terminal prompt functionJeff King, Dec 8, 2011
  8. Jakub NarebskiDec 8, 2011
  9. Jeff KingDec 8, 2011
  10. 6/7 prompt: use git_terminal_promptJeff King, Dec 8, 2011
  11. 7/7 credential: use git_prompt instead of git_getpassJeff King, Dec 8, 2011

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.