On Thu, 31 Jan 2013 14:38:45 -0500 Jeff King wrote: JK> On Thu, Jan 31, 2013 at 10:23:51AM -0500, Ted Zlatanov wrote: >> Jeff, is there a way for git-credential to currently support >> authinfo/netrc parsing? I assume that's the right way, instead of using >> Michal's proposal to parse internally? >> >> I'd like to add that, plus support for the 'string' and "string" >> formats, and authinfo.gpg decoding through GPG. I'd write it in Perl, >> if there's a choice. JK> Yes, you could write a credential helper that understands netrc and JK> friends; git talks to the helpers over a socket, so there is no problem JK> with writing it in Perl. See Documentation/technical/api-credentials.txt JK> for an overview, or the sample implementation in credential-store.c for a JK> simple example. I wrote a Perl credential helper for netrc parsing which is pretty robust, has built-in docs with -h, and doesn't depend on external modules. The netrc parser regex was stolen from Net::Netrc. It will by default use ~/.authinfo.gpg, ~/.netrc.gpg, ~/.authinfo, and ~/.netrc (whichever is found first) and this can be overridden with -f. If the file name ends with ".gpg", it will run "gpg --decrypt FILE" and use the output. So non-interactively, that could hang if GPG was waiting for input. Does Git handle that, or should I check for a TTY? Take a look at the proposed patch and let me know if it's usable, if you need a formal copyright assignment, etc. Thanks Ted