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

Re: Disabling credential helper?

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Dec 4, 2014, 00:42 UTC
Message-ID
<20141204004231.GA200195@vauxhall.crustytoothpaste.net>
In-Reply-To
<20141203012148.GB29427@peff.net>
On Tue, Dec 02, 2014 at 08:21:48PM -0500, Jeff King wrote:
> We could teach the credential-helper code to do that (e.g., a helper
> returns "stop=true" and we respect that). But I think you can do it
> reasonably well today by making the input process fail. Sadly setting
> GIT_ASKPASS to "false" just makes git complain and then try harder[1].

Yes, I did notice that. I tried /bin/false at first, and was a bit surprised it wasn't effective.

> But you can dissociate git from the terminal, like:
> 
>   $ setsid -w git ls-remote https://github.com/private/repo
>   fatal: could not read Username for 'https://github.com': No such device or address

I think this is a bit heavy-handed for my needs. At work, we develop on headless VMs, so we use SSH for pushing since we can forward the agent. At home, I use Kerberos, so the prompt generally indicates I need to run kinit.

In neither case do I actually want to enter a password, so the environment variable will work fine, I think, since it sounds like it's at least semi-supported and it works well in scripts and in configuration files.

Also, having to patch the Perl git wrappers to use setsid would be more inconvenience than it's worth.

> That might have other fallouts if you use process groups for anything. I
> have no problem with either an option to disable the terminal prompting,
> or teaching the credential-helper interface to allow helpers to stop
> lookup, either of which would be cleaner.

I'll probably submit a patch to disable the terminal prompting this weekend.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Previous: Junio C HamanoNext: Jeff King
Message 9 of 17 in “Disabling credential helper?”
  1. brian m. carlsonDec 3, 2014
  2. Jonathan NiederDec 3, 2014
  3. Jeff KingDec 3, 2014
  4. Jonathan NiederDec 3, 2014
  5. Jeff KingDec 3, 2014
  6. Jeff KingDec 4, 2014
  7. Junio C HamanoDec 4, 2014
  8. Junio C HamanoDec 3, 2014
  9. brian m. carlsonDec 4, 2014
  10. 0/2 disabling terminal promptsJeff King, Dec 4, 2014
  11. 1/2 credential: let helpers tell us to quitJeff King, Dec 4, 2014
  12. 2/2 prompt: respect GIT_TERMINAL_PROMPT to disable terminal promptsJeff King, Dec 4, 2014
  13. Junio C HamanoDec 4, 2014
  14. Jeff KingDec 4, 2014
  15. Junio C HamanoDec 4, 2014
  16. Jeff KingDec 5, 2014
  17. Junio C HamanoDec 5, 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.