On Tue, 05 Feb 2013 12:23:00 -0800 Junio C Hamano wrote:
JCH> Ted Zlatanov 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 t
Ted Zlatanov 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 "default" en
On Tue, 05 Feb 2013 11:47:56 -0800 Junio C Hamano wrote:
JCH> Ted Zlatanov 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
Ted Zlatanov 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:
>
> JCH>
On Tue, 05 Feb 2013 08:15:48 -0800 Junio C Hamano wrote:
JCH> Ted Zlatanov 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 that what Git calls
Junio C Hamano 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 from this list:
Ted Zlatanov 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 %rmap are
wh
Ted Zlatanov writes:
> On Mon, 04 Feb 2013 16:15:47 -0800 Junio C Hamano wrote:
>
> JCH> Ted Zlatanov writes:
>
>>> - do you want to support backslashed newlines?
>
> JCH> What for? netrc/authinfo is not a line oriented file format at all,
> JCH> and
>
> JCH> machine k.org
> JCH>
On Mon, 04 Feb 2013 16:15:47 -0800 Junio C Hamano wrote:
JCH> Ted Zlatanov writes:
>> - do you want to support backslashed newlines?
JCH> What for? netrc/authinfo is not a line oriented file format at all,
JCH> and
JCH>machine k.org
JCH>login me
JCH>
Ted Zlatanov writes:
> On Mon, 04 Feb 2013 15:40:32 -0800 Junio C Hamano 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 abnorma
On Mon, 04 Feb 2013 15:40:32 -0800 Junio C Hamano 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 PATCHv4 until
On Mon, 4 Feb 2013 18:23:17 -0500 Jeff King 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
Ted Zlatanov 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';
>
Jeff King 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;
>>
On Mon, 04 Feb 2013 14:56:06 -0800 Junio C Hamano 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 newlines?
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
Ted Zlatanov writes:
> Signed-off-by: Ted Zlatanov
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 %options = (
> +
Signed-off-by: Ted Zlatanov
---
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 a/contrib/credential/netrc/git-credential-netrc
b/con
18 matches
Mail list logo