quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] [PATCH] Work around GNU patch limitation of patch format


From: Jean Delvare
Subject: Re: [Quilt-dev] [PATCH] Work around GNU patch limitation of patch format
Date: Wed, 26 Feb 2014 11:54:52 +0100

Hi Andreas,

Le Tuesday 25 February 2014 à 16:04 +0100, Jean Delvare a écrit :
> On Tue, 25 Feb 2014 15:19:16 +0100, Andreas Grünbacher wrote:
> > Am 25.02.2014 14:24 schrieb "Jean Delvare" <address@hidden>:
> > > GNU patch is unable to deal with patch headers without timestamps if
> > > a file name includes a space. Quilt currently generates such patches
> > > if $QUILT_NO_DIFF_TIMESTAMPS is defined.
> > >
> > > In order to work around this limitation and always generate patches
> > > that GNU patch will be able to apply, add a tab and a dash after the
> > > file name in the patch header if $QUILT_NO_DIFF_TIMESTAMPS is set and
> > > the file name contains a space.
> >
> > Please no, let's fix patch instead.
> 
> Well, I reported the problem to the bug-patch list 2 weeks ago:
> http://lists.gnu.org/archive/html/bug-patch/2014-02/msg00000.html
> 
> But I didn't get any reply. So at this point I have no idea if it is
> actually considered a bug in GNU patch, or a limitation of the unified
> patch format. Do you know is this format is officially specified
> somewhere, BTW? That would be useful in such cases, to figure out what
> would be considered the correct behavior.
> 
> I can't wait forever for the GNU patch developers to reply, which is
> why I came up with this workaround. If the problem is ever fixed in GNU
> patch, I'll be more than happy to remove the workaround.

I did some more research and it seems that this is already fixed. Recent
versions of GNU diff will add double quotes around file names containing
spaces (and possibly other characters.) Since version 2.7, GNU patch
understands this, and will patch the right file, even if no timestamp is
present.

So I suppose that this is what we should do, too. There are two problems
with this approach though:

1* We currently require GNU patch version >= 2.5. If we start quoting
file names in patch headers, we will have to require GNU patch version
>= 2.7. That's quite a big jump, especially if you consider that version
2.7 was released less than 2 years ago (September 2012.)

Honestly, I'd rather remove the corner case from the test suite than
require GNU patch version >= 2.7.

2* The rest of the quilt code is not yet ready to deal with quoted file
names in patch headers. At least "quilt patches" will not find matches
in unapplied patches, and there may be more issues.

I suppose we want to fix this anyway, regardless of the specific point
being discussed here, as people may import such patches generated by
recent versions of GNU diff.

Note that "git diff" solves the problem by adding a tab after the file
name, as I initially did, and not by quoting the file name. So the tab
trick is apparently considered an acceptable solution after all.

-- 
Jean Delvare
Suse L3 Support




reply via email to

[Prev in Thread] Current Thread [Next in Thread]