threads / bug / 2963

git format-patch shell quoting bug

Subject: git format-patch shell quoting bug

## tl;dr

3 messages between Jan 4, 2006 and Jan 7, 2006.

replies: 2people: 2as markdown or json

Kyle McMartin· Jan 4, 2006, 04:55 UTC · lore
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· Jan 7, 2006, 02:38 UTC · re: Kyle McMartin · lore

Re: git format-patch shell quoting bug

Kyle McMartin <kyle@mcmartin.ca> writes:
Show 8 quoted lines
> 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· Jan 7, 2006, 19:16 UTC · re: Junio C Hamano · lore

Re: git format-patch shell quoting bug

On Fri, Jan 06, 2006 at 06:38:16PM -0800, Junio C Hamano wrote:
Show 14 quoted lines
>     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 

← back to recent threads