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

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

From
Jeff King <peff@peff.net>
Date
Feb 4, 2013, 21:17 UTC
Message-ID
<20130204211726.GB13186@sigill.intra.peff.net>
In-Reply-To
<87ehgvua6h.fsf@lifelogs.com>
On Mon, Feb 04, 2013 at 02:54:30PM -0500, Ted Zlatanov wrote:
Show 5 quoted lines
> +	print <<EOHIPPUS;
> +
> +$0 [-f AUTHFILE] [-d] get
> +
> +Version $VERSION by tzz\@lifelogs.com.  License: BSD.

This here-doc is interpolated so you can use $0 and $VERSION, and therefore have to quote the @-sign. But later in the here-doc...

> +Thus, when we get "protocol=https\nusername=tzz", this credential
> +helper will look for lines in AUTHFILE that match
Do you need to quote "\n" here?
Show 7 quoted lines
> +die "Sorry, you need to specify an existing netrc file (with or without a .gpg extension) with -f AUTHFILE"
> + unless defined $file;
> +
> +unless (-f $file) {
> +	print STDERR "Sorry, the specified netrc $file is not accessible\n" if $debug;
> +	exit 0;
> +}
Hmm, so it's not an error (just a warning) to say:
  git credential-netrc -f /does/not/exist
but it is an error to say:
  git credential-netrc

and have it fail to find any netrc files. Shouldn't the latter be a lesser error than the former?

Show 7 quoted lines
> +while (<STDIN>) {
> +	next unless m/([^=]+)=(.+)/;
> +
> +	my ($token, $value) = ($1, $2);
> +	die "Unknown search token $1" unless exists $q{$token};
> +	$q{$token} = $value;
> +}

Should this regex be anchored at the start of the string? I think the left-to-right matching means we will correctly match:

  key=value with=in it
so it may be OK.
> +if ($debug) {
> +	printf STDERR "searching for %s = %s\n", $_, $q{$_} || '(any value)'
> +	 foreach sort keys %q;
> +}
Leftover one-char indent.
> [...]
The rest looks OK to me.
Previous: Ted ZlatanovNext: Ted Zlatanov
Message 2 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.