# Features ask for git-send-email

8 messages from 2006-04-29 to 2006-05-02. Participants: Bertrand Jacquin, David Woodhouse, Jakub Narebski.
Thread: https://gitlist.dev/t/3998

## Bertrand Jacquin, 2006-04-29 13:30

Subject: Features ask for git-send-email
Message-ID: <4fb292fa0604290630r19edd7ejf88642e33b350d1d@mail.gmail.com>
URL: https://gitlist.dev/e/4fb292fa0604290630r19edd7ejf88642e33b350d1d%40mail.gmail.com

```
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, 2006-05-02 12:36

Subject: Re: Features ask for git-send-email
Message-ID: <1146573417.14059.21.camel@pmac.infradead.org>
URL: https://gitlist.dev/e/1146573417.14059.21.camel%40pmac.infradead.org
In-Reply-To: <4fb292fa0604290630r19edd7ejf88642e33b350d1d@mail.gmail.com>

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

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, 2006-05-02 12:53

Subject: Re: Features ask for git-send-email
Message-ID: <e37km0$vav$1@sea.gmane.org>
URL: https://gitlist.dev/e/e37km0%24vav%241%40sea.gmane.org
In-Reply-To: <1146573417.14059.21.camel@pmac.infradead.org>

```
David Woodhouse wrote:

> 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, 2006-05-02 14:14

Subject: Re: Features ask for git-send-email
Message-ID: <1146579255.17934.8.camel@pmac.infradead.org>
URL: https://gitlist.dev/e/1146579255.17934.8.camel%40pmac.infradead.org
In-Reply-To: <e37km0$vav$1@sea.gmane.org>

```
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, 2006-05-02 15:35

Subject: Re: Features ask for git-send-email
Message-ID: <e37u5r$4pi$1@sea.gmane.org>
URL: https://gitlist.dev/e/e37u5r%244pi%241%40sea.gmane.org
In-Reply-To: <1146579255.17934.8.camel@pmac.infradead.org>

```
David Woodhouse wrote:

> 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, 2006-05-02 22:46

Subject: Re: Features ask for git-send-email
Message-ID: <4fb292fa0605021546i45c740c4i42c64125b8c560e@mail.gmail.com>
URL: https://gitlist.dev/e/4fb292fa0605021546i45c740c4i42c64125b8c560e%40mail.gmail.com
In-Reply-To: <1146573417.14059.21.camel@pmac.infradead.org>

```
On 5/2/06, David Woodhouse <dwmw2@infradead.org> wrote:
> 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, 2006-05-02 23:33

Subject: Re: Features ask for git-send-email
Message-ID: <1146612793.19101.50.camel@pmac.infradead.org>
URL: https://gitlist.dev/e/1146612793.19101.50.camel%40pmac.infradead.org
In-Reply-To: <4fb292fa0605021546i45c740c4i42c64125b8c560e@mail.gmail.com>

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

-- 
dwmw2

```

## Bertrand Jacquin, 2006-05-02 23:51

Subject: Re: Features ask for git-send-email
Message-ID: <4fb292fa0605021651y1e0cbb69w7f34257bacca716f@mail.gmail.com>
URL: https://gitlist.dev/e/4fb292fa0605021651y1e0cbb69w7f34257bacca716f%40mail.gmail.com
In-Reply-To: <1146612793.19101.50.camel@pmac.infradead.org>

```
On 5/3/06, David Woodhouse <dwmw2@infradead.org> wrote:
> 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

```
