On Wed, 20 Feb 2013 19:44:51 -0500 Ted Zlatanov <
t...@lifelogs.com> wrote:
TZ> On Thu, 14 Feb 2013 10:17:46 +0100 R�mi Vanicat <
remi.v...@gmail.com> wrote:
RV> Julien Cubizolles <
j.cubi...@free.fr> writes:
>>> I'm a new (and happy) user of magit. I've tried to add login/password to
>>> my .authinfo file to save typing it at each git operation but couldn't
>>> figure out the right syntax.
>>> Here is what I tried.
>>> machine
github.com protocol https login *mylogin* password
>>> *mypassword*
RV> We didn't yet wrote the code needed for magit to use standard Emacs
RV> authentication, so there is nothing you can do, but wrote the code
RV> yourself, or wait for some good man to do it.
RV> I use ssh and ssh-agent for this, so I've to enter only once a
RV> passphrase for all my git activities (on github and elsewhere)
TZ> Hello Julien and R�mi,
TZ> the Git credential helper protocol is good enough to handle this. On
TZ> the git developer mailing list I have proposed a netrc credential helper
TZ> that will look up login name and password from a .authinfo/.netrc file
TZ> (using GPG if it has the .gpg suffix). It's OK mostly, except I still
TZ> have to write tests for it, so I'd expect it to make it into an upcoming
TZ> Git release, and it's in contrib/ so it can be pulled out for standalone
TZ> use. Julien, if you're interested, you can look at the patch and test
TZ> it out for yourself.
TZ> Practically, the application of the netrc credential helper is that all
TZ> the wrappings of Emacs' auth-source.el will not be needed. Git itself
TZ> respects the GIT_CONFIG environment variable, so Magit could pass a
TZ> special gitconfig file with the netrc credential helper specified, but I
TZ> think it's better to make the user handle it and document it. Either
TZ> way, Git will consult the netrc credential helper, which takes the
TZ> problem off Magit's hands. I think that's the right approach with Git
TZ> because it's an external tool.
TZ> The best part of this solution is that the netrc credential helper is
TZ> just one of many. The user could choose to use the GNOME Keyring, the
TZ> Secrets API, or the Mac OS X keychain through the appropriate credential
TZ> helper. Magit and Emacs don't have to care.
The Git netrc credential helper is in Git's `next' branch so it can be
expected to show up in the next release. Give it a try and let me know
if it works for you, please.
Ted