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, 21:08 UTC
Message-ID
<20151030210849.GA7149@sigill.intra.peff.net>
In-Reply-To
<CAM-tV-8qSVJFOxLQt9SaYK_WqpxixzPArJnAK=3tHU9inM9Law@mail.gmail.com>
On Thu, Oct 29, 2015 at 09:20:01PM -0400, Noam Postavsky wrote:
Show 7 quoted lines
> On Thu, Oct 29, 2015 at 8:50 PM, Jeff King <peff@peff.net> wrote:
> > workaround (the real inelegance is that you are assuming that "foo"
> > needs run in the first place).
> 
> Well, we currently check the output from "git config
> credential.helpers" to determine what's needed, so the inelegance here
> is that we reimplement git's checking of this option.

Right. And not only is that hard to get right (I doubt, for example, you support the arbitrary "!" shell expressions that git does), but it's impossible to know for sure that will be needed, because you cannot know all possible helpers (I might even have a helper that is a shell snippet that calls credential-cache).

As a workaround, I don't think looking for just "cache" is unreasonable. But it is not a very robust solution. :)

Show 12 quoted lines
> > I'm still not sure how the pre-helper would work. What git command kicks
> > off the pre-helper command? Wouldn't it also be subject to the SIGHUP
> > problem?
> 
> Ah, maybe the missing piece I forgot to mention is that we could make
> our pre/1st-helper be an emacsclient command, which would tell Emacs
> to startup the daemon. So the daemon would be a subprocess of Emacs,
> not "git push", thereby avoiding the SIGHUP. In our current workaround
> we startup the daemon (if it's not running) before git commands that
> we think are going to run credential helpers (i.e. "push", "pull",
> "fetch"), hence my thought that it would be nicer if we only did that
> before git is *actually* going to run the helpers.

I don't think even git knows it will need a helper until it is actually ready to call one (e.g., it may depend on getting an HTTP 401 from the server).

I am leaning more towards ignoring SIGHUP (configurably) being the only really sane path forward. Do you want to try your hand at a patch?

-Peff
Previous: Noam PostavskyNext: Noam Postavsky
Message 19 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.