git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jerzy Kozera <jerzy.kozera@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, msclrhd@googlemail.com,
	Jerzy Kozera <jerzy.kozera@gmail.com>
Subject: [PATCH] git-p4: Fixed handling of file names with spaces
Date: Thu, 13 Jan 2011 18:51:55 +0000	[thread overview]
Message-ID: <1294944715-5647-1-git-send-email-jerzy.kozera@gmail.com> (raw)
In-Reply-To: <AANLkTi=Cp=FCuJdthr7JfML6jdNzUiDAUPjrWpTQfWGk@mail.gmail.com>

Hi,

I've noticed the same issue in reopen and rm calls - not saying these three are all occurences of this problem, but I guess fixing them is a good start.

I'm using \" instead of '' quoting for consistency with rest of the file.

Regards,
Jerzy
---
 contrib/fast-import/git-p4 |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 04ce7e3..2147315 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -139,12 +139,12 @@ def setP4ExecBit(file, mode):
         if p4Type[-1] == "+":
             p4Type = p4Type[0:-1]
 
-    p4_system("reopen -t %s %s" % (p4Type, file))
+    p4_system("reopen -t %s \"%s\"" % (p4Type, file))
 
 def getP4OpenedType(file):
     # Returns the perforce file type for the given file.
 
-    result = p4_read_pipe("opened %s" % file)
+    result = p4_read_pipe("opened \"%s\"" % file)
     match = re.match(".*\((.+)\)\r?$", result)
     if match:
         return match.group(1)
@@ -666,7 +666,7 @@ class P4Submit(Command):
                 for f in editedFiles:
                     p4_system("revert \"%s\"" % f);
                 for f in filesToAdd:
-                    system("rm %s" %f)
+                    system("rm \"%s\"" % f)
                 return
             elif response == "a":
                 os.system(applyPatchCmd)
-- 
1.7.1

  reply	other threads:[~2011-01-13 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 20:56 [PATCH] git-p4: Fix 'p4 opened' in git-p4 for names with spaces Jerzy Kozera
2010-12-14 20:56 ` Jerzy Kozera
2010-12-14 23:16   ` Junio C Hamano
2010-12-14 23:36     ` Reece Dunn
2011-01-13 18:51       ` Jerzy Kozera [this message]
2011-01-14 22:01         ` [PATCH] git-p4: Fixed handling of file " Andreas Schwab
2011-01-14 22:45           ` Jerzy Kozera
2011-01-15 14:35             ` Pete Wyckoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294944715-5647-1-git-send-email-jerzy.kozera@gmail.com \
    --to=jerzy.kozera@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=msclrhd@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).