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

Re: [PATCH] send-email: Fix %config_path_settings handling

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 14, 2011, 19:26 UTC
Message-ID
<7vbotjz85o.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201110142049.32734.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 9 quoted lines
> From: Cord Seele <cowose@gmail.com>
>    value... which admittedly is a bit cryptic.  More readable if more
>    verbose option would be to use hash reference, e.g.:
>
>         my %config_bool_settings = (
>             "thread" => { variable => \$thread, default => 1},
>             [...]
>
>    Or something like that.
Do you really want to leave this "Or something like that" here?
> 3. 994d6c6 (send-email: address expansion for common mailers, 2006-05-14)
>    didn't add test for alias expansion to t9001-send-email.sh
I was hoping that an updated patch to have a new test or two here...
> Signed-off-by: Cord Seele <cowose@gmail.com>
> Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Is this the version tested by Michael?
Show 9 quoted lines
> +		my $target = $config_path_settings{$setting};
> +		if (ref($target) eq "ARRAY" && !@$target) {
> +			# multi-valued and not set
> +			my @values = Git::config_path(@repo, "$prefix.$setting");
> +			@$target = @values if (@values && defined $values[0]);
> +		} elsif (!defined $$target) {
> +			# multi-valued and not set
> +			$$target = Git::config_path(@repo, "$prefix.$setting");
> +		}

If the target is an array ref and for whatever reason the array is already populated, wouldn't you check "if (!defined $$target)" with this change?

Previous: Jakub NarebskiNext: Jakub Narebski
Message 9 of 11 in “[BUG] send-email: alias expansion broken”
  1. Michael J GruberOct 14, 2011
  2. fix alias expansion with new Git::config_path()Cord Seele, Oct 14, 2011
  3. Michael J GruberOct 14, 2011
  4. Cord SeeleOct 14, 2011
  5. Junio C HamanoOct 14, 2011
  6. Jakub NarebskiOct 14, 2011
  7. Junio C HamanoOct 14, 2011
  8. send-email: Fix %config_path_settings handlingJakub Narebski, Oct 14, 2011
  9. Junio C HamanoOct 14, 2011
  10. Jakub NarebskiOct 14, 2011
  11. Junio C HamanoOct 14, 2011

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.