Skip Menu |

This queue is for tickets about the Git-FastExport CPAN distribution.

Report information
The Basics
Id: 81342
Status: resolved
Priority: 0/
Queue: Git-FastExport

People
Owner: Nobody in particular
Requestors: cpan [...] sourcentral.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.07
Fixed in: 0.08



Subject: git-stitch-repo creates path with additional double quote
git fast-export uses double quotes around filenames with special utf8 characters: D "test\303\204" M 100644 :1 "test\303\226" git fast-import in general can work with this. When remapping those files to a different directory with git-stitch-repo the new directory is prefixed in front of the quotes. web/"test\303\226" git fast-import failes and creates a file named web/\"test\303\226 The attached patch prefixes the new directory path after a doublequote if present.
Subject: stitch.patch
--- Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm.org 2012-09-20 07:23:41.000000000 +0200 +++ Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm 2012-11-22 09:31:41.119311977 +0100 @@ -184,15 +184,15 @@ for ( @{ $block->{files} } ) { s/^M (\d+) :(\d+)/M $1 :$mark_map->{$repo}{$2}/; if ( my $dir = $self->{repo}{$repo}{dir} ) { - s!^(M \d+ :\d+) (.*)!$1 $dir/$2!; # filemodify - s!^D (.*)!D $dir/$1!; # filedelete + s!^(M \d+ :\d+) (\"?)(.*)!$1 $2$dir/$3!; # filemodify + s!^D (\"?)(.*)!D $1$dir/$2!; # filedelete # /!\ quotes may happen - die and fix if needed die "Choked on quoted paths in $repo! Culprit:\n$_\n" if /^[CR] \S+ \S+ /; # filecopy | filerename - s!^([CR]) (\S+) (\S+)!$1 $dir/$2 $dir/$3!; + s!^([CR]) (\"?)(\S+) (\"?)(\S+)!$1 $2$dir/$3 $4$dir/$5!; } } }
Subject: Re: [rt.cpan.org #81342] git-stitch-repo creates path with additional double quote
Date: Thu, 22 Nov 2012 15:48:37 +0100
To: Oliver Paukstadt via RT <bug-Git-FastExport [...] rt.cpan.org>
From: "Philippe Bruhat (BooK)" <book [...] cpan.org>
On Thu, Nov 22, 2012 at 08:32:28AM -0500, Oliver Paukstadt via RT wrote: Show quoted text
> --- Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm.org 2012-09-20 07:23:41.000000000 +0200 > +++ Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm 2012-11-22 09:31:41.119311977 +0100 > @@ -184,15 +184,15 @@ > for ( @{ $block->{files} } ) { > s/^M (\d+) :(\d+)/M $1 :$mark_map->{$repo}{$2}/; > if ( my $dir = $self->{repo}{$repo}{dir} ) { > - s!^(M \d+ :\d+) (.*)!$1 $dir/$2!; # filemodify > - s!^D (.*)!D $dir/$1!; # filedelete > + s!^(M \d+ :\d+) (\"?)(.*)!$1 $2$dir/$3!; # filemodify > + s!^D (\"?)(.*)!D $1$dir/$2!; # filedelete > > # /!\ quotes may happen - die and fix if needed > die "Choked on quoted paths in $repo! Culprit:\n$_\n" > if /^[CR] \S+ \S+ /;
Are the above lines still needed? Show quoted text
> > # filecopy | filerename > - s!^([CR]) (\S+) (\S+)!$1 $dir/$2 $dir/$3!; > + s!^([CR]) (\"?)(\S+) (\"?)(\S+)!$1 $2$dir/$3 $4$dir/$5!; > } > } > }
-- Philippe Bruhat (BooK) A wish is only as good as the wisher and what he can achieve. (Moral from Groo The Wanderer #35 (Epic))
On Thu Nov 22 09:48:47 2012, BOOK wrote: Show quoted text
> > # /!\ quotes may happen - die and fix if needed > > die "Choked on quoted paths in $repo! Culprit:\n$_\n" > > if /^[CR] \S+ \S+ /;
> > Are the above lines still needed? >
As far as I can see, a file with space in name is not quoted at all, but I can only build [MD] lines, no [CR] lines. M 100644 :1 test test So this check might be still relevant. The error message is misleading, as it is an unquoted space in name.