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

Re: [PATCH] send-email: Honor multi-part email messages

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2011, 19:26 UTC
Message-ID
<7v1uvb6mn9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1316507347-6693-1-git-send-email-zapped@mail.ru>
Alexey Shumkin <zapped@mail.ru> writes:
Show 19 quoted lines
> diff --git a/git-send-email.perl b/git-send-email.perl
> index 98ab33a..1abf4a4 100755
> --- a/git-send-email.perl
> +++ b/git-send-email.perl
> @@ -1403,12 +1403,17 @@ sub file_has_nonascii {
>  
>  sub body_or_subject_has_nonascii {
>  	my $fn = shift;
> +	my $multipart = 0;
>  	open(my $fh, '<', $fn)
>  		or die "unable to open $fn: $!\n";
>  	while (my $line = <$fh>) {
>  		last if $line =~ /^$/;
> +		if ($line =~ /^Content-Type:\s*multipart\/mixed.*$/) {
> +			$multipart = 1;
> +		}
>  		return 1 if $line =~ /^Subject.*[^[:ascii:]]/;
>  	}
> +	return 0 if $multipart;

Looks as if you can lose the extra variable and return 0 immediately when you find a line with that Content-Type inside the loop.

What am I missing?
Previous: Alexey ShumkinNext: Alexey Shumkin
Message 2 of 7 in “send-email: Honor multi-part email messages”
  1. send-email: Honor multi-part email messagesAlexey Shumkin, Sep 20, 2011
  2. Junio C HamanoSep 20, 2011
  3. Alexey ShumkinSep 20, 2011
  4. Alexey ShumkinJan 24, 2013
  5. Junio C HamanoJan 24, 2013
  6. Shumkin AlexeyJan 24, 2013
  7. Junio C HamanoJan 24, 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.