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 27, 2015, 18:47 UTC
Message-ID
<20151027184702.GB12717@sigill.intra.peff.net>
In-Reply-To
<xmqqoafkci6j.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 27, 2015 at 10:52:52AM -0700, Junio C Hamano wrote:
Show 19 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > But these days, people often have several simultaneous sessions open.
> > They may have multiple ssh sessions to a single machine, or they may
> > have a bunch of terminal windows open, each of which has a login shell
> > and will send HUP to its children when it exits. In that case, you have
> > a meta-session surrounding those individual terminal sessions, and you
> > probably do want to keep the cache going as long as the meta session[1].
> > ...
> > [1] Of course we have no idea when that meta-session is closed. But if
> >     you have a script that runs on X logout, for instance, you could put
> >     "git credential-cache exit" in it.
> 
> Yes.  Probably the right way forward is to make it a non-issue by
> teaching users how to control the lifetime of the "daemon" process,
> and wean them off relying on "it is auto-spawned if you forgot to
> start", as that convenience of auto-spawning is associated with
> "...but how it is auto-shutdown really depends on many things in
> your specific environment", which is the issue.

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.

AFAICT, it works pretty well out of the box for most setups (where terminals do _not_ send SIGHUP; so we auto-start, and then it holds the credential until the timer expires).

I am a little surprised that credential-cache gets wide use. I would think most people would prefer to use a system-specific secure-storage helper. I don't know what the state of the art is for that on Linux[1], but we seem to have only gnome-keyring in contrib/.

-Peff
[1] I use Linux, but I do not use any of the common desktop
    environments. However, I have my own personal read-only key program
    that speaks the helper protocol.
Previous: Junio C HamanoNext: Noam Postavsky
Message 13 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.