Re: [PATCHv5] Add contrib/credentials/netrc with GPG support
- From
Ted Zlatanov <tzz@lifelogs.com>
- Date
- Feb 6, 2013, 00:34 UTC
- Message-ID
- <87a9rip9fr.fsf@lifelogs.com>
- In-Reply-To
- <7vip66qu0u.fsf@alter.siamese.dyndns.org>
On Tue, 05 Feb 2013 14:24:01 -0800 Junio C Hamano <gitster@pobox.com> wrote:
JCH> Ted Zlatanov <tzz@lifelogs.com> writes:
>> + $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