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

Re: [PATCH] git-send-email: skip RFC2047 quoting for ASCII subjects

From
Jeff King <peff@peff.net>
Date
Oct 25, 2012, 09:01 UTC
Message-ID
<20121025090149.GC8390@sigill.intra.peff.net>
In-Reply-To
<20121024210826.GA23562@shrek.podlesie.net>
On Wed, Oct 24, 2012 at 11:08:26PM +0200, Krzysztof Mazur wrote:
Show 21 quoted lines
> ok, I'm sending a version that just adds quote_subject() without
> changing any logic, so now we still have in first case:
> 
>  /[^[:ascii:]]/
> 
> and in the latter case:
>  
>  !is_rfc2047_quoted($subject) && /^[:ascii:]]/
> 
> 
> In the next patch I will just add matching for "=?" in 
> subject_needs_rfc2047_quoting() and we will have:
> 
>    /=?/ || /[^[:ascii:]]/
> 
> and in the latter case:
>  
>    !is_rfc2047_quoted($subject) && (/=\?/ || /^[:ascii:]]/)
> 
> This will also add quoting for any rfc2047 quoted subject or any
> other rfc2047-like subject, as you suggested.
Thanks, the two-patch series you outline makes a lot of sense to me.
Show 6 quoted lines
> Krzysiek
> -- 
> From a70c5385f9b4da69a8ce00a1448f87f63bbd500d Mon Sep 17 00:00:00 2001
> From: Krzysztof Mazur <krzysiek@podlesie.net>
> Date: Wed, 24 Oct 2012 22:46:00 +0200
> Subject: [PATCH] git-send-email: introduce quote_subject()

When sending a patch following some cover letter material, please cut out any non-essential headers and use the scissors symbol, like this:

  -- >8 --
  Subject: [PATCH] this subject overrides the whole email's subject
  the regular body and diff go here...

That format is understood by "git am" and means I do not have to manually munge it, which saves a little work.

Show 9 quoted lines
> +sub quote_subject {
> + 	local $subject = shift;
> + 	my $encoding = shift || 'UTF-8';
> +
> + 	if (subject_needs_rfc2047_quoting($subject)) {
> +		return quote_rfc2047($subject, $encoding);
> + 	}
> + 	return $subject;
> +}
There is some funny whitespace here (space followed by tab).
Show 6 quoted lines
> -	if ($broken_encoding{$t} && !is_rfc2047_quoted($subject) &&
> -			($subject =~ /[^[:ascii:]]/)) {
> -		$subject = quote_rfc2047($subject, $auto_8bit_encoding);
> +	if ($broken_encoding{$t} && !is_rfc2047_quoted($subject)) {
> +		$subject = quote_subject($subject, $auto_8bit_encoding);
>  	}

Hmm. What is this patch on top of? It looks like it is on top of your original patch, but when I tried it on top of that, it does not apply either, and the index lines in the patch do not mention a sha1 that I do not have.

Do you mind re-rolling a final 2-patch series with:
  1. Your original patch and this one squashed together, with an
     appropriate commit message.
  2. The second "quote when we see '=?'" patch.
Thanks.
-Peff
Previous: Jeff KingNext: Jeff King
Message 8 of 12 in “git-send-email: skip RFC2047 quoting for ASCII subjects”
  1. git-send-email: skip RFC2047 quoting for ASCII subjectsKrzysztof Mazur, Oct 24, 2012
  2. Jeff KingOct 24, 2012
  3. Krzysztof MazurOct 24, 2012
  4. Jeff KingOct 24, 2012
  5. Krzysztof MazurOct 24, 2012
  6. git-send-email: add rfc2047 quoting for "=?"Krzysztof Mazur, Oct 24, 2012
  7. Jeff KingOct 25, 2012
  8. Jeff KingOct 25, 2012
  9. Jeff KingOct 25, 2012
  10. Krzysztof MazurOct 25, 2012
  11. Jeff KingOct 25, 2012
  12. Krzysztof MazurOct 25, 2012

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.