Re: [PATCH] git-p4: Fixed handling of file names with spaces

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

 



jerzy.kozera@xxxxxxxxx wrote on Fri, 14 Jan 2011 22:45 +0000:
> On 14 Jan 2011, at 22:01, Andreas Schwab wrote:
> > Can those file names also include a double quote or a backquote or a
> > dollar sign?
> 
> 
> Double quote and backquote get escaped by git so they are not a problem:
> $ git diff-tree -r HEAD^ HEAD
> :000000 100644 0000000000000000000000000000000000000000 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 A	"\" \\ $"
> 
> But as you can see above, the dollar sign remains intact, so it needs to be handled as well - patch below takes it into account.
[..]
> -    p4_system("reopen -t %s %s" % (p4Type, file))
> +    p4_system("reopen -t %s \"%s\"" % (p4Type, file))

These changes are important for correctness.  Thanks for fixing
them.

It is kind of ugly to have to do file escaping all over the
source.  I'd rather see all the os.system() calls go away, in
favor of subprocess.Popen().  You can use the latter without
going through the shell at all, hence no escapes are needed.
If you feel ambitious, this would be a nice fix.

Spaces can happen in depot paths too.  That isn't handled
current.  All the p4Cmd and p4CmdList calls that work on
depotPaths should avoid going through the shell too.

But at least what you have done already should go in.  If you
feel adventurous, addressing these other space-related issues
would be nice too.

		-- Pete
--
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]