{"thread":{"id":"6430","subject":"git-send-email --suppress-from option doesn't work.","startedAt":"2007-01-18T21:07:24Z","lastAt":"2007-01-25T16:47:32Z","messageCount":3,"participants":["Timur Tabi","Andreas Ericsson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"32022","messageId":"45AFE18C.2020303@freescale.com","threadId":"6430","inReplyTo":null,"subject":"git-send-email --suppress-from option doesn't work.","fromName":"Timur Tabi","fromEmail":"timur@freescale.com","sentAt":"2007-01-18T21:07:24Z","receivedAt":"2007-01-18T21:07:24Z","isPatch":false,"sender":{"key":"timur@freescale.com","avatar":null},"body":"The --suppress-from option doesn't work for me because the comparison is too strict.\n\nHere's an example usage of git-send-email:\n\ngit-send-email --suppress-from --from timur@freescale.com --to timur@tabi.org \n--smtp-server remotesmtp.freescale.net 0001-Add-support-for-the-MPC8349E-mITX-GP.txt\n\nI need to specify the --from option, because otherwise git-send-email will \nprompt me for a From address, and I don't want it to prompt me for anything.\n\nThe problem is that the patchfile contains this line:\n\nFrom: Timur Tabi <timur@freescale.com>\n\nThat means that the patchfile contains the string \"Timur Tabi \n<timur@freescale.com>\", but the --from specifies the string \n\"timur@freescale.com\".  The code which checks the suppress-from option is here:\n\n                         } elsif (/^(Cc|From):\\s+(.*)$/) {\n                                 if ($2 eq $from) {\n                                         next if ($suppress_from);\n                                 }\n\nI don't know Perl, but I'm guess the The \"$2 eq $from\" is a strict comparison \nthat fails in my case.\n\nSome of you might say at this point, \"Why don't you  just specify --from \"Timur \nTabi <timur@freescale.com>\"?  I tried that, and it still doesn't work.\n\nBasically, what I want is to prevent git-send-email from CC'ing me on my own \npatches.  No matter what I do, I can't prevent it from adding \"Cc: Timur Tabi \n<timur@freescale.com>\" to the email header.\n\n-- \nTimur Tabi\nLinux Kernel Developer @ Freescale\n"},{"id":"32028","messageId":"45B01DD4.7000204@op5.se","threadId":"6430","inReplyTo":"45AFE18C.2020303@freescale.com","subject":"Re: git-send-email --suppress-from option doesn't work.","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2007-01-19T01:24:36Z","receivedAt":"2007-01-19T01:24:36Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"\n\nTimur Tabi wrote:\n> The --suppress-from option doesn't work for me because the comparison is\n> too strict.\n> \n> Here's an example usage of git-send-email:\n> \n> git-send-email --suppress-from --from timur@freescale.com --to\n> timur@tabi.org --smtp-server remotesmtp.freescale.net\n> 0001-Add-support-for-the-MPC8349E-mITX-GP.txt\n> \n> I need to specify the --from option, because otherwise git-send-email\n> will prompt me for a From address, and I don't want it to prompt me for\n> anything.\n> \n> The problem is that the patchfile contains this line:\n> \n> From: Timur Tabi <timur@freescale.com>\n> \n> That means that the patchfile contains the string \"Timur Tabi\n> <timur@freescale.com>\", but the --from specifies the string\n> \"timur@freescale.com\".  The code which checks the suppress-from option\n> is here:\n> \n>                         } elsif (/^(Cc|From):\\s+(.*)$/) {\n\nI believe\n\n\t(/^(Cc|From):[^<]+<([^>])+>.*$/)\n\nwould do the trick for your case. It would however fail when specifying a proper\n--from address in the 'git commit --author=\"Foo Barson <foo@barson.com>\"' style.\n\nAre you sure you need to specify --from for those patches though?\n\n>                                 if ($2 eq $from) {\n>                                         next if ($suppress_from);\n>                                 }\n> \n> I don't know Perl, but I'm guess the The \"$2 eq $from\" is a strict\n> comparison that fails in my case.\n> \n> Some of you might say at this point, \"Why don't you  just specify --from\n> \"Timur Tabi <timur@freescale.com>\"?  I tried that, and it still doesn't\n> work.\n> \n\nThat sounds extremely odd indeed. Could this have to do with character\nconversion?\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"32619","messageId":"45B8DF24.6080001@freescale.com","threadId":"6430","inReplyTo":"45B01DD4.7000204@op5.se","subject":"Re: git-send-email --suppress-from option doesn't work.","fromName":"Timur Tabi","fromEmail":"timur@freescale.com","sentAt":"2007-01-25T16:47:32Z","receivedAt":"2007-01-25T16:47:32Z","isPatch":false,"sender":{"key":"timur@freescale.com","avatar":null},"body":"Andreas Ericsson wrote:\n\n> \n> I believe\n> \n> \t(/^(Cc|From):[^<]+<([^>])+>.*$/)\n> \n> would do the trick for your case. It would however fail when specifying a proper\n> --from address in the 'git commit --author=\"Foo Barson <foo@barson.com>\"' style.\n\nEven so, it would still be very picky about the layout.  --suppress-from should \njust compare the actual email addresses, not the names or any other characters.\n\n> Are you sure you need to specify --from for those patches though?\n\nYes.  If I don't specify --from, then git-send-email will prompt me for the \nFrom: address.  I want git-send-email to be completely non-interactive.\n\n>> Some of you might say at this point, \"Why don't you  just specify --from\n>> \"Timur Tabi <timur@freescale.com>\"?  I tried that, and it still doesn't\n>> work.\n> \n> That sounds extremely odd indeed. Could this have to do with character\n> conversion?\n\nActually, I figured out the problem is that I can't do this:\n\nFROM='--from \"Foo Barson <foo@barson.com>\"'\ngit-send-email $FROM ...\n\nI got all sorts of weird messages about unbalanced > or something.  Instead, I \nneed to do this:\n\nFROM=\"Foo Barson <foo@barson.com>\"\ngit-send-email --from $FROM ...\n\nThis is probably a shell issue instead of a git-send-email issue, but it is \nannoying.\n\n-- \nTimur Tabi\nLinux Kernel Developer @ Freescale\n"}]}