Re: [PATCHv5] Add contrib/credentials/netrc with GPG support
From: Ted Zlatanov <hidden>
Date: 2016-06-15 22:56:04
On Tue, 05 Feb 2013 14:24:01 -0800 Junio C Hamano [off-list ref] wrote: JCH> Ted Zlatanov [off-list ref] writes:
quoted
+ $f =~ s/([;<>\*\|`&\$!#\(\)\[\]\{\}:'"])/\\$1/g;
JCH> Yuck. If you really have to quote, it is often far simpler to take
JCH> advantage of the fact that quoting rule for shell is much simpler
JCH> inside '', i.e.
JCH> sub sq {
JCH> my ($string) = @_;
JCH> $string =~ s|'|'\\''|g;
JCH> return "'$string'";
JCH> }
Oh, that's nice. Thanks. We don't need it anymore, but I'm sad to see
it go unused.
JCH> I think it is saner to do something like this instead here:
JCH> $mach = { machine => undef }
JCH> Otherwise your log_debug() will be filled by the tokens used for the
JCH> default entry, and also this "undef $mach" here will break your
JCH> macdef skipping logic if the default entry has a macdef, I think.
JCH> You can ignore an entry with undefined "machine" in the loop at the
JCH> end of load_netrc.
Cool, I merged your changes into PATCHv6. I'll keep in mind about
merging the trailing else braces, too. I forgot that setting for
cperl-mode (`cperl-merge-trailing-else . t').
Thanks
Ted