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: Thu, 29 Oct 2015 20:10:01 -0400	[thread overview]
Message-ID: <20151030001000.GA2123@sigill.intra.peff.net> (raw)
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:

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

  reply	other threads:[~2015-10-30  0:10 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 [this message]
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
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=20151030001000.GA2123@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).