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

Re: [PATCH] fix alias expansion with new Git::config_path()

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Oct 14, 2011, 14:30 UTC
Message-ID
<4E984781.6050601@drmicha.warpmail.net>
In-Reply-To
<20111014142557.GB13680@laptop>
Cord Seele venit, vidit, dixit 14.10.2011 16:25:
Show 40 quoted lines
> On Fri 14 Oct 2011 14:29:27 +0200, Michael J Gruber <git@drmicha.warpmail.net> wrote:
> 
>> cec5dae (use new Git::config_path() for aliasesfile, 2011-09-30)
>>
>> broke the expansion of aliases for me:
>>
>> ./git-send-email --cc=junio  --dry-run
>> 0001-t7800-avoid-arithmetic-expansion-notation.patch
>> 0001-t7800-avoid-arithmetic-expansion-notation.patch
>> Who should the emails appear to be from? [Michael J Gruber
>> <git@drmicha.warpmail.net>]
>> Emails will be sent from: Michael J Gruber <git@drmicha.warpmail.net>
>> Dry-OK. Log says:
>> Sendmail: /home/mjg/bin/msmtp-fastmail-git -i git@vger.kernel.org junio
>> git@drmicha.warpmail.net
>> From: Michael J Gruber <git@drmicha.warpmail.net>
>> To: git@vger.kernel.org
>> Cc: junio
>> ...
>>
>> Happens with both "--cc junio" and "--cc=junio".
>>
>> Reverting cec5dae brings my aliases back. Relevant config:
>>
>> git config --get-regexp sendemail.alias\*
>> sendemail.aliasesfile /home/mjg/git/gitauthors
>> sendemail.aliasfiletype mutt
>>
>> Can I please have alias expansion back?
> 
> The following patch fixes it for me, please give it a try.
> 
> Since this fix is simply copy&pasting some code from the config_settings path
> someone with better perl understanding might wnat to refactor it
> (Junio/Jacob)?
> 
> -- Cord
> 
> 
> Signed-off-by: Cord Seele <cowose@gmail.com>
Tested-by: Michael J Gruber <git@drmicha.warpmail.net>
Thanks. (Though I'm still wondering what this is about overall.)
Show 27 quoted lines
> ---
>  git-send-email.perl |   12 ++++++++++--
>  1 files changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 91607c5..6885dfa 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -337,8 +337,16 @@ sub read_config {
>  	}
>  
>  	foreach my $setting (keys %config_path_settings) {
> -		my $target = $config_path_settings{$setting}->[0];
> -		$$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target);
> +		my $target = $config_path_settings{$setting};
> +		if (ref($target) eq "ARRAY") {
> +			unless (@$target) {
> +				my @values = Git::config_path(@repo, "$prefix.$setting");
> +				@$target = @values if (@values && defined $values[0]);
> +			}
> +		}
> +		else {
> +			$$target = Git::config_path(@repo, "$prefix.$setting") unless (defined $$target);
> +		}
>  	}
>  
>  	foreach my $setting (keys %config_settings) {
Previous: Cord SeeleNext: Cord Seele
Message 3 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.