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

Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?

From
Jeff King <peff@peff.net>
Date
Oct 30, 2015, 00:10 UTC
Message-ID
<20151030001000.GA2123@sigill.intra.peff.net>
In-Reply-To
<CAM-tV--B3HaC1DcORfnx9bWW9-quyk0=pQDxmvonc=6dgrMOxA@mail.gmail.com>
On Tue, Oct 27, 2015 at 11:46:20PM -0400, Noam Postavsky wrote:
Show 12 quoted lines
> > I dunno. I think the auto-spawn is really what makes it usable; you can
> > drop it in with "git config credential.helper config" and forget about
> > it. Anything more fancy requires touching your login/startup files.
> > Certainly I'm not opposed to people setting it up outside of the
> > auto-spawn, but I wouldn't want that feature to go away.
> 
> Perhaps we could express the auto-spawn more explicitly, something
> like "git config credential.pre-helper start-cache-daemon". A way to
> run a command before the credential helpers start would be useful to
> our magit workaround for this issue (currently we start the daemon
> before "push", "fetch", and "pull", but it won't work with user
> aliases that run those commands).

I'm not clear on when the pre-helper would be run. Git runs the helper when it needs a credential. What git command would start it? Or are you proposing a new credential interface for programs (like magit) to call along the lines of "do any prep work you need; I might be asking for a credential soon", without having to know the specifics of the user's helper config.

You can do that already like:
  echo url=dummy://a:b@c/ | git credential approve

though I guess for some helpers, that may actually store the bogus value (for the cache, it inserts a dummy cache entry, but that's not a problem; something with permanent storage would be more annoying).

I guess the most elegant thing would be to add an "init" command to the helper interface. So magit would run:

  git credential init

which would then see that we have "credential.helper" defined as "foo", and would run:

  git credential-foo init

which could be a noop, start a daemon, or whatever, depending on how the helper operates.

I dunno. It almost seems like adding a credentialcache.ignoreHUP option would be less hacky. :)

> I'm not sure it's that widely used. Perhaps most people use ssh-agent?
> That's what I do, though I've been experimenting with credential-cache
> since it was brought up by a magit user.

I don't know. Certainly up until a few years ago, anybody sane was using ssh-agent, because the http password stuff was so awful (no storage, and we didn't even respect 401s for a long time). But these days sites like GitHub push people into using https as the protocol of choice. Mostly, I think, because there was a lot of support load in teaching people to set up ssh. But I guess a lot of those people are on non-Linux platforms.

-Peff
Previous: Noam PostavskyNext: Noam Postavsky
Message 15 of 29 in “git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?”
  1. Noam PostavskyOct 10, 2015
  2. Noam PostavskyOct 18, 2015
  3. Junio C HamanoOct 18, 2015
  4. Noam PostavskyOct 19, 2015
  5. Noam PostavskyOct 21, 2015
  6. Noam PostavskyOct 24, 2015
  7. Junio C HamanoOct 25, 2015
  8. Jeff KingOct 26, 2015
  9. Noam PostavskyOct 27, 2015
  10. Jeff KingOct 27, 2015
  11. Junio C HamanoOct 27, 2015
  12. Junio C HamanoOct 27, 2015
  13. Jeff KingOct 27, 2015
  14. Noam PostavskyOct 28, 2015
  15. Jeff KingOct 30, 2015
  16. Noam PostavskyOct 30, 2015
  17. Jeff KingOct 30, 2015
  18. Noam PostavskyOct 30, 2015
  19. Jeff KingOct 30, 2015
  20. Noam PostavskyNov 9, 2015
  21. Jeff KingNov 9, 2015
  22. Noam PostavskyNov 10, 2015
  23. Jeff KingNov 10, 2015
  24. Jeff KingNov 10, 2015
  25. Noam PostavskyNov 11, 2015
  26. Junio C HamanoDec 4, 2015
  27. Jeff KingDec 4, 2015
  28. Junio C HamanoDec 4, 2015
  29. Jeff KingDec 4, 2015

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.