Re: (Resend)[PATCH] git-svn: Translate invalid characters in refname

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

 



Junio C Hamano <gitster@xxxxxxxxx> wrote:
> Robert Ewald <robert.ewald@xxxxxxx> writes:
> 
> > +sub refname {
> > +        my ($refname) = "refs/remotes/$_[0]->{ref_id}" ;
> > +
> > +        # It cannot end with a slash /, we'll throw up on this because
> > +        # SVN can't have directories with a slash in their name, either:
> > +        if ($refname =~ m{/$}) {
> > +                die "ref: '$refname' ends with a trailing slash, this is ",
> > +                    "not permitted by git nor Subversion\n";
> > +        }
> > +
> > +        # It cannot have ASCII control character space, tilde ~, caret ^,
> > +        # colon :, question-mark ?, asterisk *, space, or open bracket [
> > +        # anywhere.
> > +        #
> > +        # Additionally, % must be escaped because it is used for escaping
> > +        # and we want our escaped refname to be reversible
> > +        $refname =~ s{([ \%~\^:\?\*\[\t])}{uc sprintf('%%%02x',ord($1))}eg;
> 
> uc of sprintf()?  You meant "%%%02X"?

Ah, I wasn't sure if X was portable enough, but then again this sprintf
is in Perl.

> Other than that, looks sane to me.  I presume that SVN branches
> whose name would be mangled with this patch would not have been
> successfully imported with older git-svn anyway, so this won't
> introduce any regressions?

Seems alright to me, I haven't had a chance to look at it too hard.  I'm
out of town and haven't been following the mailing list lately.

Acked-by: Eric Wong <normalperson@xxxxxxxx>

-- 
Eric Wong
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux