threads / discuss / 3998

Features ask for git-send-email

Subject: Features ask for git-send-email

## tl;dr

8 messages between Apr 29, 2006 and May 2, 2006.

replies: 7people: 3as markdown or json

Bertrand Jacquin· Apr 29, 2006, 13:30 UTC · lore
Hi,

Could it be possible to add a features in git-send-email.perl to accept a differrent charset as iso-8859-1 ? I would like to send fr_FR.utf8 mail as I use git to manager a latex files tree which are written in utf8.

Any objection ?

-- Beber #e.fr@freenode

David Woodhouse· May 2, 2006, 12:36 UTC · re: Bertrand Jacquin · lore

Re: Features ask for git-send-email

On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
Show 6 quoted lines
> Could it be possible to add a features in git-send-email.perl to
> accept a differrent charset as iso-8859-1 ? I would like to send
> fr_FR.utf8 mail as I use git to manager a latex files tree which are
> written in utf8.
> 
> Any objection ?

Seems reasonable. I think we just forgot to include the Content-Type: header. This fixes it...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
diff --git a/git-send-email.perl b/git-send-email.perl
index ecfa347..1df75f5 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -37,7 +37,7 @@ # Constants (essentially)
 my $compose_filename = ".msg.$$";
 
 # Variables we fill in automatically, or via prompting:
-my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time);
+my (@to,@cc,@initial_cc,$initial_reply_to,$initial_subject,@files,$from,$compose,$time,$charset);
 
 # Behavior modification variables
 my ($chain_reply_to, $smtp_server, $quiet, $suppress_from, $no_signed_off_cc) = (1, "localhost", 0, 0, 0);
@@ -58,6 +58,7 @@ my $rc = GetOptions("from=s" => \$from,
 		    "chain-reply-to!" => \$chain_reply_to,
 		    "smtp-server=s" => \$smtp_server,
 		    "compose" => \$compose,
+		    "charset=s" => \$charset,
 		    "quiet" => \$quiet,
 		    "suppress-from" => \$suppress_from,
 		    "no-signed-off-cc|no-signed-off-by-cc" => \$no_signed_off_cc,
@@ -135,6 +136,10 @@ if (!defined $smtp_server) {
 	$smtp_server = "localhost";
 }
 
+if (!defined $charset) {
+	$charset = "UTF-8";
+}
+
 if ($compose) {
 	# Note that this does not need to be secure, but we will make a small
 	# effort to have it be unique
@@ -214,6 +219,9 @@ Options:
    --cc           Specify an initial "Cc:" list for the entire series
                   of emails.
 
+   --charset      Specify a character set, if legacy character sets are
+                  used in change logs instead of UTF-8.
+
    --compose      Use \$EDITOR to edit an introductory message for the
                   patch series.
 
@@ -299,6 +307,7 @@ Subject: $subject
 Reply-To: $from
 Date: $date
 Message-Id: $message_id
+Content-Type: text/plain; charset=$charset
 X-Mailer: git-send-email @@GIT_VERSION@@
 ";
 	$header .= "In-Reply-To: $reply_to\n" if $reply_to;
-- 
dwmw2
Jakub Narebski· May 2, 2006, 12:53 UTC · re: David Woodhouse · lore

Re: Features ask for git-send-email

David Woodhouse wrote:
Show 10 quoted lines
> On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
>> Could it be possible to add a features in git-send-email.perl to
>> accept a differrent charset as iso-8859-1 ? I would like to send
>> fr_FR.utf8 mail as I use git to manager a latex files tree which are
>> written in utf8.
>> 
>> Any objection ?
> 
> Seems reasonable. I think we just forgot to include the Content-Type:
> header. This fixes it...
Doesn't 
        Content-Type: text/plain; charset=$charset
header need also
        MIME-Version: 1.0
-- 
Jakub Narebski
Warsaw, Poland
David Woodhouse· May 2, 2006, 14:14 UTC · re: Jakub Narebski · lore

Re: Features ask for git-send-email

On Tue, 2006-05-02 at 14:53 +0200, Jakub Narebski wrote:
> Doesn't 
>         Content-Type: text/plain; charset=$charset
> header need also
>         MIME-Version: 1.0 

Maybe. The use of Content-Type: actually predates RFC2045, and if we include a MIME-Version header then we should make 100% sure that we also conform to the rest of RFC2045, which I hadn't actually looked at. In particular, we should take care of Content-Transfer-Encoding.

I'd prefer to leave MIME-Version out for now, I think.
-- 
dwmw2
Jakub Narebski· May 2, 2006, 15:35 UTC · re: David Woodhouse · lore

Re: Features ask for git-send-email

David Woodhouse wrote:
Show 12 quoted lines
> On Tue, 2006-05-02 at 14:53 +0200, Jakub Narebski wrote:
>> Doesn't
>>         Content-Type: text/plain; charset=$charset
>> header need also
>>         MIME-Version: 1.0
> 
> Maybe. The use of Content-Type: actually predates RFC2045, and if we
> include a MIME-Version header then we should make 100% sure that we also
> conform to the rest of RFC2045, which I hadn't actually looked at. In
> particular, we should take care of Content-Transfer-Encoding.
> 
> I'd prefer to leave MIME-Version out for now, I think.

If I remember correctly _some_ mail applications or news (Usenet) agents did not respect Content-Type without MIME-Version, I think according to standard. Perhaps that have changed.

As to the other MIME header:
        Content-Transfer-Encoding: 8bit
-- 
Jakub Narebski
Warsaw, Poland
Bertrand Jacquin· May 2, 2006, 22:46 UTC · re: David Woodhouse · lore

Re: Features ask for git-send-email

On 5/2/06, David Woodhouse <dwmw2@infradead.org> wrote:
Show 10 quoted lines
> On Sat, 2006-04-29 at 15:30 +0200, Bertrand Jacquin wrote:
> > Could it be possible to add a features in git-send-email.perl to
> > accept a differrent charset as iso-8859-1 ? I would like to send
> > fr_FR.utf8 mail as I use git to manager a latex files tree which are
> > written in utf8.
> >
> > Any objection ?
>
> Seems reasonable. I think we just forgot to include the Content-Type:
> header. This fixes it...
I tryed it. I used this patch again master git git release
And I got the following with git-send-email :

Use of uninitialized value in hash element at /usr/bin/git-send-email line 437. Use of uninitialized value in hash element at /usr/bin/git-send-email line 437. <>: missing or malformed local part Use of uninitialized value in hash element at /usr/bin/git-send-email line 437. Use of uninitialized value in hash element at /usr/bin/git-send-email line 437. <>: missing or malformed local part

And with my smtp server :

2006-05-03 00:44:01 unexpected disconnection while reading SMTP command from localhost (localhost.localdomain) [127.0.0.1]

Is it a known bug ? I can't send mail with patch thow :/ I tried to add Mime-Version: 1.0 too but I got the sam.

-- Beber #e.fr@freenode

David Woodhouse· May 2, 2006, 23:33 UTC · re: Bertrand Jacquin · lore

Re: Features ask for git-send-email

On Wed, 2006-05-03 at 00:46 +0200, Bertrand Jacquin wrote:
Show 7 quoted lines
> I tryed it. I used this patch again master git git release
> 
> And I got the following with git-send-email :
> 
> Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> <>: missing or malformed local part 

Interesting; it worked for me. Does the same happen _without_ the patch applied?

-- 
dwmw2
Bertrand Jacquin· May 2, 2006, 23:51 UTC · re: David Woodhouse · lore

Re: Features ask for git-send-email

On 5/3/06, David Woodhouse <dwmw2@infradead.org> wrote:
Show 11 quoted lines
> On Wed, 2006-05-03 at 00:46 +0200, Bertrand Jacquin wrote:
> > I tryed it. I used this patch again master git git release
> >
> > And I got the following with git-send-email :
> >
> > Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> > Use of uninitialized value in hash element at /usr/bin/git-send-email line 437.
> > <>: missing or malformed local part
>
> Interesting; it worked for me. Does the same happen _without_ the patch
> applied?

It appear without in 1.3.1 and I can't seed mail with too. Also, 1.2.4 work fine here (without patch).

I don't make any test for other version (too tired for now).
I use exim 4.60 as SMTP server (if it can help).

-- Beber #e.fr@freenode

← back to recent threads