git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] git-send-email: skip RFC2047 quoting for ASCII subjects
Date: Thu, 25 Oct 2012 05:01:49 -0400	[thread overview]
Message-ID: <20121025090149.GC8390@sigill.intra.peff.net> (raw)
In-Reply-To: <20121024210826.GA23562@shrek.podlesie.net>

On Wed, Oct 24, 2012 at 11:08:26PM +0200, Krzysztof Mazur wrote:

> 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.

> 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.

> +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).

> -	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

  parent reply	other threads:[~2012-10-25  9:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24  8:03 [PATCH] git-send-email: skip RFC2047 quoting for ASCII subjects Krzysztof Mazur
2012-10-24  8:46 ` Jeff King
2012-10-24 17:10   ` Krzysztof Mazur
2012-10-24 19:25     ` Jeff King
2012-10-24 21:08       ` Krzysztof Mazur
2012-10-24 21:28         ` [PATCH] git-send-email: add rfc2047 quoting for "=?" Krzysztof Mazur
2012-10-25  9:05           ` Jeff King
2012-10-25  9:01         ` Jeff King [this message]
2012-10-25 10:08           ` [PATCH] git-send-email: skip RFC2047 quoting for ASCII subjects Jeff King
2012-10-25 11:19             ` Krzysztof Mazur
2012-10-25 11:21               ` Jeff King
2012-10-25 11:12           ` Krzysztof Mazur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121025090149.GC8390@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=krzysiek@podlesie.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).