git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCHv6] Add contrib/credentials/netrc with GPG support

From
Ted Zlatanov <tzz@lifelogs.com>
Date
Feb 25, 2013, 16:24 UTC
Message-ID
<87621guztp.fsf@lifelogs.com>
In-Reply-To
<20130208061855.GA11892@sigill.intra.peff.net>
On Fri, 8 Feb 2013 01:18:55 -0500 Jeff King <peff@peff.net> wrote: 
>> +	# the following check is copied from Net::Netrc, for non-GPG files
>> +	# OS/2 and Win32 do not handle stat in a way compatable with this check :-(
JK> s/compatable/compatible/
This is from the Net::Netrc module.  Fixed in my commit but eh...
JK> You mention os/2 and Win32 here, but the check has more:
Show 5 quoted lines
>> +	unless ($gpgmode || $options{insecure} ||
>> +		$^O eq 'os2'
>> +		|| $^O eq 'MSWin32'
>> +		|| $^O eq 'MacOS'
>> +		|| $^O =~ /^cygwin/) {
JK> Does MacOS really not handle stat? Or is this old MacOS, not OS X?

This is all out of Net::Netrc, and yes, it's pre-Mac OS X. I think it's safe to leave as is, but I can remove OS/2 and MacOS if you prefer.

JK> So this will convert: JK> machine foo port smtp JK> in the netrc into (protocol => "smtp", host => "foo"), but: JK> machine foo port 25 JK> into (protocol => undef, host => "foo:25"), right? That makes sense to JK> me.

Yes.  test.pl checks that host=foo doesn't find the above, as well.

JK> I don't know if you want to take the hit of relying on Git.pm (it is JK> nice for the helper to be totally standalone and copy-able), but one JK> obvious possible refactor would be to use the credential read/write JK> functions recently added there. I'm OK with not doing that, though.

JK> It may also be worth building on top of the regular git test harness. JK> It's more work, but the resulting code (and the output) will be much JK> more readable.

At least for now let's leave it standalone. When and if it moves into the core, we can change it to use the core's Git.pm and test suite. The code and the tests are small enough that I think using Perl's Test module makes the most sense right now.

JK> Printf? Bleh, isn't this supposed to be perl? :P
What?  Was I supposed to use formats?!?!

JK> You are depending on whatever the user has in their ~/.netrc, no? JK> Wouldn't it make more sense to ship a sample netrc and run all of the JK> tests with "-f netrc.example"?

Yes.  See test.netrc.

Thanks Ted

Previous: Jeff KingNext: Ted Zlatanov
Message 32 of 38 in “Add contrib/credentials/netrc with GPG support”
  1. Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 4, 2013
  2. Jeff KingFeb 4, 2013
  3. Ted ZlatanovFeb 4, 2013
  4. Add contrib/credentials/netrc with GPG support, try #2Ted Zlatanov, Feb 4, 2013
  5. Junio C HamanoFeb 4, 2013
  6. Jeff KingFeb 4, 2013
  7. Junio C HamanoFeb 4, 2013
  8. Ted ZlatanovFeb 4, 2013
  9. [PATCHv3] Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 4, 2013
  10. Ted ZlatanovFeb 4, 2013
  11. Junio C HamanoFeb 4, 2013
  12. Ted ZlatanovFeb 4, 2013
  13. Junio C HamanoFeb 5, 2013
  14. Ted ZlatanovFeb 5, 2013
  15. Junio C HamanoFeb 5, 2013
  16. Junio C HamanoFeb 5, 2013
  17. Junio C HamanoFeb 5, 2013
  18. Ted ZlatanovFeb 5, 2013
  19. [PATCHv4] Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 5, 2013
  20. Junio C HamanoFeb 5, 2013
  21. Ted ZlatanovFeb 5, 2013
  22. Junio C HamanoFeb 5, 2013
  23. Ted ZlatanovFeb 5, 2013
  24. [PATCHv5] Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 5, 2013
  25. Junio C HamanoFeb 5, 2013
  26. Junio C HamanoFeb 5, 2013
  27. [PATCHv6] Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 6, 2013
  28. Junio C HamanoFeb 7, 2013
  29. Ted ZlatanovFeb 8, 2013
  30. Junio C HamanoFeb 8, 2013
  31. Jeff KingFeb 8, 2013
  32. Ted ZlatanovFeb 25, 2013
  33. Add contrib/credentials/netrc with GPG supportTed Zlatanov, Feb 25, 2013
  34. Ted ZlatanovFeb 6, 2013
  35. Junio C HamanoFeb 5, 2013
  36. Ted ZlatanovFeb 5, 2013
  37. Junio C HamanoFeb 5, 2013
  38. Ted ZlatanovFeb 5, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.