git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Noam Postavsky <npostavs@users.sourceforge.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead?
Date: Fri, 30 Oct 2015 17:08:49 -0400	[thread overview]
Message-ID: <20151030210849.GA7149@sigill.intra.peff.net> (raw)
In-Reply-To: <CAM-tV-8qSVJFOxLQt9SaYK_WqpxixzPArJnAK=3tHU9inM9Law@mail.gmail.com>

On Thu, Oct 29, 2015 at 09:20:01PM -0400, Noam Postavsky wrote:

> 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. :)

> > 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

  reply	other threads:[~2015-10-30 21:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-10 16:45 git-credential-cache--daemon quits on SIGHUP, can we change it to ignore instead? Noam Postavsky
2015-10-18 15:15 ` Noam Postavsky
2015-10-18 17:58   ` Junio C Hamano
2015-10-19  0:51     ` Noam Postavsky
2015-10-21  2:35     ` Noam Postavsky
2015-10-24 21:47       ` Noam Postavsky
2015-10-25 16:58         ` Junio C Hamano
2015-10-26 21:50           ` Jeff King
2015-10-27  0:50             ` Noam Postavsky
2015-10-27 18:41               ` Jeff King
2015-10-27 19:04                 ` Junio C Hamano
2015-10-27 17:52             ` Junio C Hamano
2015-10-27 18:47               ` Jeff King
2015-10-28  3:46                 ` Noam Postavsky
2015-10-30  0:10                   ` Jeff King
2015-10-30  0:43                     ` Noam Postavsky
2015-10-30  0:50                       ` Jeff King
2015-10-30  1:20                         ` Noam Postavsky
2015-10-30 21:08                           ` Jeff King [this message]
2015-11-09  2:58                             ` Noam Postavsky
2015-11-09 15:53                               ` Jeff King
2015-11-10  1:05                                 ` Noam Postavsky
2015-11-10 12:25                                   ` Jeff King
2015-11-10 12:26                                     ` Jeff King
2015-11-11  0:22                                       ` Noam Postavsky
2015-12-04 18:55                                     ` Junio C Hamano
2015-12-04 19:06                                       ` Jeff King
2015-12-04 20:05                                         ` Junio C Hamano
2015-12-04 23:25                                           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151030210849.GA7149@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).