# git format-patch shell quoting bug

3 messages from 2006-01-04 to 2006-01-07. Participants: Kyle McMartin, Junio C Hamano.
Thread: https://gitlist.dev/t/2963

## Kyle McMartin, 2006-01-04 04:55

Subject: git format-patch shell quoting bug
Message-ID: <20060104045519.GB29515@quicksilver.road.mcmartin.ca>
URL: https://gitlist.dev/e/20060104045519.GB29515%40quicksilver.road.mcmartin.ca

```
Hi,

There's apparently a quoting bug in git-format-patch. When I import
a patch with apply-mbox, for example

From: Carlos O'Donell <carlos@parisc-linux.org>

The author field is correctly set, including the "'" in Carlos' name.

So when I go to rebase my tree, or send out patches, I 
"git-format-patch origin" and get...

/usr/bin/git-format-patch: eval: line 200: unexpected EOF while looking for 
matching `''
/usr/bin/git-format-patch: eval: line 201: syntax error: unexpected end of file

Which produces a bogus output patch with a blank From and Date,

Subject: [PATCH] ...
From:
Date:

[...]

I believe this recently crept in, as I don't recall seeing it before.

Cheers,
	Kyle

```

## Junio C Hamano, 2006-01-07 02:38

Subject: Re: git format-patch shell quoting bug
Message-ID: <7vhd8gpxt3.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhd8gpxt3.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20060104045519.GB29515@quicksilver.road.mcmartin.ca>

```
Kyle McMartin <kyle@mcmartin.ca> writes:

> There's apparently a quoting bug in git-format-patch. When I import
> a patch with apply-mbox, for example
>
> From: Carlos O'Donell <carlos@parisc-linux.org>
>
> The author field is correctly set, including the "'" in Carlos' name.
> ...
> I believe this recently crept in, as I don't recall seeing it before.

Thanks for spotting this.

There was a similar problem with "git-commit -c".  I think I got
both of them right with commit aa66c7:

    commit aa66c7ec77d474b737da607d6cb2d07f56628def
    Author: Junio C Hamano <junkio@cox.net>
    Date:   Thu Jan 5 19:50:37 2006 -0800

        format-patch/commit: Quote single quote in the author name properly.

        Noticed by Kyle McMartin.

        Signed-off-by: Junio C Hamano <junkio@cox.net>

The bug was present ever since format-patch started picking up
the original authorship information from the commits, done on
July 22nd last year, between v0.99.1 and v0.99.2.

```

## Kyle McMartin, 2006-01-07 19:16

Subject: Re: git format-patch shell quoting bug
Message-ID: <20060107191640.GD15084@quicksilver.road.mcmartin.ca>
URL: https://gitlist.dev/e/20060107191640.GD15084%40quicksilver.road.mcmartin.ca
In-Reply-To: <7vhd8gpxt3.fsf@assigned-by-dhcp.cox.net>

```
On Fri, Jan 06, 2006 at 06:38:16PM -0800, Junio C Hamano wrote:
>     commit aa66c7ec77d474b737da607d6cb2d07f56628def
>     Author: Junio C Hamano <junkio@cox.net>
>     Date:   Thu Jan 5 19:50:37 2006 -0800
> 
>         format-patch/commit: Quote single quote in the author name properly.
> 
>         Noticed by Kyle McMartin.
> 
>         Signed-off-by: Junio C Hamano <junkio@cox.net>
> 
> The bug was present ever since format-patch started picking up
> the original authorship information from the commits, done on
> July 22nd last year, between v0.99.1 and v0.99.2.
>

Awesome. Thanks very much for fixing this!

Cheers,
	Kyle 

```
