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

Re: [PATCH] git-credential-netrc: fix uninitialized warning

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 8, 2013, 20:02 UTC
Message-ID
<20131008200235.GG9464@google.com>
In-Reply-To
<87li23v8p5.fsf@flea.lifelogs.com>
Ted Zlatanov wrote:
> On Tue, 8 Oct 2013 12:41:47 -0700 Jonathan Nieder <jrnieder@gmail.com> wrote: 
> JN> Ted Zlatanov wrote:
>>> Simple patch to avoid unitialized warning and log what we'll do.
> JN> Sign-off?
>
> I didn't realize it was a requirement, must I?

See Documentation/SubmittingPatches, section '(5) Sign your work' for what this means.

If you just forgot to sign off, that's fine and I can forge it or go without. If you are unable to sign off because you don't have the right to submit the change under an open source license, I'd be a bit worried going forward.

[...]
Show 11 quoted lines
> JN> Or more simply, would it make sense to wrap both 'defined' checks into
> JN> a single "if", like so?
>
> JN> 		if (defined $entry->{$check} && defined $query->{$check}) {
> JN> 			...
> JN> 		} else {
> JN> 			log_debug(...);
> JN> 		}
>
> I prefer the explicit version because we can issue a more precise
> log_debug message.
That's fine with me.
After this patch, the code looks like
	if (!defined $entry->{$check}) {
		log_debug(...);
	} elsif (defined $query->{$check}) {
		...
	} else {
		log_debug(...);
	}

As a small nit, wouldn't it be more readable with the two !defined() cases together?

	if (!defined $entry->{$check}) {
		...
	} elsif (!defined $query->{$check}) {
		...
	} else {
		...
	}

Thanks again. Jonathan

Previous: Ted ZlatanovNext: Ted Zlatanov
Message 6 of 7 in “git-credential-netrc: fix uninitialized warning”
  1. git-credential-netrc: fix uninitialized warningTed Zlatanov, Oct 8, 2013
  2. Jonathan NiederOct 8, 2013
  3. Ted ZlatanovOct 8, 2013
  4. Stefan BellerOct 8, 2013
  5. Ted ZlatanovOct 8, 2013
  6. Jonathan NiederOct 8, 2013
  7. Ted ZlatanovOct 8, 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.