Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: On Mon, 04 Feb 2013 16:15:47 -0800 Junio C Hamano gits...@pobox.com wrote: JCH Ted Zlatanov t...@lifelogs.com writes: - do you want to support backslashed newlines? JCH What for? netrc/authinfo is not a line oriented file format at all, JCH and

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: +# build reverse token map +my %rmap; +foreach my $k (keys %{$options{tmap}}) { + push @{$rmap{$options{tmap}-{$k}}}, $k; +} Mental note: $rmap{foo} -eq 'bar' means that what Git calls 'bar' is found as 'foo' in the netrc/authinfo file. Keys in

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: I thought I've given a more concrete outline than I'll read Net::Netrc and do whatever I think it does in a separate message. And it turns out that the message was sitting in my outbox. Sorry. I just told the outbox to send it out. -- To unsubscribe

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Ted Zlatanov
On Tue, 05 Feb 2013 08:15:48 -0800 Junio C Hamano gits...@pobox.com wrote: JCH Ted Zlatanov t...@lifelogs.com writes: +# build reverse token map +my %rmap; +foreach my $k (keys %{$options{tmap}}) { +push @{$rmap{$options{tmap}-{$k}}}, $k; +} JCH Mental note: $rmap{foo} -eq 'bar' means

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: JCH Oh, another thing. 'default' is like 'machine' followed by any JCH machine name, so the above while loop that reads two tokens JCH pair-wise needs to be aware that 'default' is not followed by a JCH value. I think the loop will fail to parse this:

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Ted Zlatanov
On Tue, 05 Feb 2013 11:47:56 -0800 Junio C Hamano gits...@pobox.com wrote: JCH Ted Zlatanov t...@lifelogs.com writes: JCH Oh, another thing. 'default' is like 'machine' followed by any JCH machine name, so the above while loop that reads two tokens JCH pair-wise needs to be aware that 'default'

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-05 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: JCH You still need to parse a file that has a default entry correctly; JCH otherwise the users won't be able to share existing .netrc files JCH with other applications e.g. ftp, which is the whole point of this JCH series. Not using values from the

[PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Ted Zlatanov
Signed-off-by: Ted Zlatanov t...@lifelogs.com --- contrib/credential/netrc/git-credential-netrc | 236 + 1 files changed, 236 insertions(+), 0 deletions(-) create mode 100755 contrib/credential/netrc/git-credential-netrc diff --git

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: Signed-off-by: Ted Zlatanov t...@lifelogs.com The space above your S-o-b: could be utilized a bit better ;-) @@ -0,0 +1,236 @@ +#!/usr/bin/perl + +use strict; +use warnings; + +use Getopt::Long; +use File::Basename; + +my $VERSION = 0.1; + +my

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Jeff King
On Mon, Feb 04, 2013 at 02:56:06PM -0800, Junio C Hamano wrote: +my $mode = shift @ARGV; + +# credentials may get 'get', 'store', or 'erase' as parameters but +# only acknowledge 'get' +die Syntax: $0 [-f AUTHFILE] [-d] get unless defined $mode; + +# only support 'get' mode +exit

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Ted Zlatanov
On Mon, 04 Feb 2013 14:56:06 -0800 Junio C Hamano gits...@pobox.com wrote: JCH I recall that netrc/authinfo files are _not_ line oriented. Earlier JCH you said looks for entries that match which is a lot more correct, JCH but then we see look for lines in authfile. Hmm, do you mean backslashed

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Mon, Feb 04, 2013 at 02:56:06PM -0800, Junio C Hamano wrote: +my $mode = shift @ARGV; + +# credentials may get 'get', 'store', or 'erase' as parameters but +# only acknowledge 'get' +die Syntax: $0 [-f AUTHFILE] [-d] get unless defined $mode; +

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: +my $mode = shift @ARGV; + +# credentials may get 'get', 'store', or 'erase' as parameters but +# only acknowledge 'get' +die Syntax: $0 [-f AUTHFILE] [-d] get unless defined $mode; + +# only support 'get' mode +exit unless $mode eq 'get'; JCH The

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Ted Zlatanov
On Mon, 4 Feb 2013 18:23:17 -0500 Jeff King p...@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

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Ted Zlatanov
On Mon, 04 Feb 2013 15:40:32 -0800 Junio C Hamano gits...@pobox.com wrote: JCH Sorry we couldn't sounded like an error messag to me. If this is JCH a normal exit, then please make sure it is a normal exit. OK; done in PATCHv4: removed all Sorry because they are not abnormal exits. I'll hold

Re: [PATCH] Add contrib/credentials/netrc with GPG support, try #2

2013-02-04 Thread Junio C Hamano
Ted Zlatanov t...@lifelogs.com writes: On Mon, 04 Feb 2013 15:40:32 -0800 Junio C Hamano gits...@pobox.com wrote: JCH Sorry we couldn't sounded like an error messag to me. If this is JCH a normal exit, then please make sure it is a normal exit. OK; done in PATCHv4: removed all Sorry