From: Ted Zlatanov <tzz@lifelogs.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2
Date: Mon, 04 Feb 2013 18:42:05 -0500 [thread overview]
Message-ID: <877gmnsl2q.fsf@lifelogs.com> (raw)
In-Reply-To: <20130204232317.GA17705@sigill.intra.peff.net> (Jeff King's message of "Mon, 4 Feb 2013 18:23:17 -0500")
On Mon, 4 Feb 2013 18:23:17 -0500 Jeff King <peff@peff.net> wrote:
>> Perhaps "-r $file", if you say "is not accessible"?
JK> Even better: look at whether opening the file was successful. Though I
JK> guess that is complicated by the use of gpg, who will probably not
JK> distinguish ENOENT from other failures for us.
Yup. I think the outcome for the user will be the same, so this is
mostly for debugging, right? And we do look at the outcome of opening
the file, and die if that failed (which would change if your suggestion
below is implemented).
JK> I was trying not to be too nit-picky with my review, but here is how I
JK> would have written the outer logic of the script:
JK> my $tokens = read_credential_data_from_stdin();
JK> if ($options{file}) {
JK> my @entries = load_netrc($options{file})
JK> or die "unable to open $options{file}: $!";
JK> check_netrc($tokens, @entries);
JK> }
JK> else {
JK> foreach my $ext ('.gpg', '') {
JK> foreach my $base (qw(authinfo netrc)) {
JK> my @entries = load_netrc("$base$ext")
JK> or next;
JK> if (check_netrc($tokens, @entries)) {
JK> last;
JK> }
JK> }
JK> }
JK> }
JK> I.e., to fail on "-f", but otherwise treat unreadable auto-selected
JK> files as a no-op, for whatever reason.
JK> I'd also consider checking all files if they are available, in case
JK> the user has multiple (e.g., they keep low-quality junk unencrypted
JK> but some high-security passwords in a .gpg file). Not that likely,
JK> but not any harder to implement.
I think that makes everything more complicated, and the user can name a
specific netrc file in the helper spec if he wants it. It's too
automagic for me. But if you and Junio feel this is the right approach,
I'll rewrite to basically allow --file to take a list of filenames and
default that list to the base list of ~/.{authinfo,netrc}{,.gpg}
Ted
next prev parent reply other threads:[~2013-02-04 23:42 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-04 19:54 [PATCH] Add contrib/credentials/netrc with GPG support Ted Zlatanov
2013-02-04 21:17 ` Jeff King
2013-02-04 21:32 ` Ted Zlatanov
2013-02-04 21:44 ` [PATCH] Add contrib/credentials/netrc with GPG support, try #2 Ted Zlatanov
2013-02-04 22:56 ` Junio C Hamano
2013-02-04 23:23 ` Jeff King
2013-02-04 23:36 ` Junio C Hamano
2013-02-04 23:42 ` Ted Zlatanov [this message]
2013-02-04 23:28 ` [PATCHv3] Add contrib/credentials/netrc with GPG support Ted Zlatanov
2013-02-04 23:31 ` [PATCH] Add contrib/credentials/netrc with GPG support, try #2 Ted Zlatanov
2013-02-04 23:40 ` Junio C Hamano
2013-02-04 23:54 ` Ted Zlatanov
2013-02-05 0:15 ` Junio C Hamano
2013-02-05 13:39 ` Ted Zlatanov
2013-02-05 16:07 ` Junio C Hamano
2013-02-05 16:18 ` Junio C Hamano
2013-02-05 16:15 ` Junio C Hamano
2013-02-05 17:01 ` Ted Zlatanov
2013-02-05 18:55 ` [PATCHv4] Add contrib/credentials/netrc with GPG support Ted Zlatanov
2013-02-05 19:53 ` Junio C Hamano
2013-02-05 20:47 ` Ted Zlatanov
2013-02-05 22:09 ` Junio C Hamano
2013-02-05 22:30 ` Ted Zlatanov
2013-02-05 20:55 ` [PATCHv5] " Ted Zlatanov
2013-02-05 22:24 ` Junio C Hamano
2013-02-05 23:58 ` Junio C Hamano
2013-02-06 0:38 ` [PATCHv6] " Ted Zlatanov
2013-02-07 23:52 ` Junio C Hamano
2013-02-08 1:53 ` Ted Zlatanov
2013-02-08 6:15 ` Junio C Hamano
2013-02-08 6:18 ` Jeff King
2013-02-25 16:24 ` Ted Zlatanov
2013-02-25 15:49 ` [PATCH v7] " Ted Zlatanov
2013-02-06 0:34 ` [PATCHv5] " Ted Zlatanov
2013-02-05 19:47 ` [PATCH] Add contrib/credentials/netrc with GPG support, try #2 Junio C Hamano
2013-02-05 20:03 ` Ted Zlatanov
2013-02-05 20:23 ` Junio C Hamano
2013-02-05 21:00 ` Ted Zlatanov
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=877gmnsl2q.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.