Subject: Re: git-send-email --suppress-from option doesn't work.

From: Andreas Ericsson <[email-masked]>
Date: Fri, 19 Jan 2007 02:24:36 +0100

Timur Tabi wrote:
> The --suppress-from option doesn't work for me because the comparison is
> too strict.
> 
> Here's an example usage of git-send-email:
> 
> git-send-email --suppress-from --from [email-masked] --to
> [email-masked] --smtp-server remotesmtp.freescale.net
> 0001-Add-support-for-the-MPC8349E-mITX-GP.txt
> 
> I need to specify the --from option, because otherwise git-send-email
> will prompt me for a From address, and I don't want it to prompt me for
> anything.
> 
> The problem is that the patchfile contains this line:
> 
> From: Timur Tabi <[email-masked]>
> 
> That means that the patchfile contains the string "Timur Tabi
> <[email-masked]>", but the --from specifies the string
> "[email-masked]".  The code which checks the suppress-from option
> is here:
> 
>                         } elsif (/^(Cc|From):\s+(.*)$/) {

I believe

	(/^(Cc|From):[^<]+<([^>])+>.*$/)

would do the trick for your case. It would however fail when specifying a proper
--from address in the 'git commit --author="Foo Barson <[email-masked]>"' style.

Are you sure you need to specify --from for those patches though?

>                                 if ($2 eq $from) {
>                                         next if ($suppress_from);
>                                 }
> 
> I don't know Perl, but I'm guess the The "$2 eq $from" is a strict
> comparison that fails in my case.
> 
> Some of you might say at this point, "Why don't you  just specify --from
> "Timur Tabi <[email-masked]>"?  I tried that, and it still doesn't
> work.
> 

That sounds extremely odd indeed. Could this have to do with character
conversion?

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231