git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Put quotes around branch names to prevent special characters from being interpreted by the shell.

From
BMBenjamin C Meyer <bmeyer@rim.com>
Date
Jun 4, 2010, 15:53 UTC
Message-ID
<1275666800-31852-1-git-send-email-bmeyer@rim.com>
Perforce branch names with spaces (and other special characters) were causing issues.
Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>
---
 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c1ea643..d42b865 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1228,7 +1228,7 @@ class P4Sync(Command):
         lostAndFoundBranches = set()
 
         for info in p4CmdList("branches"):
-            details = p4Cmd("branch -o %s" % info["branch"])
+            details = p4Cmd("branch -o \"%s\"" % info["branch"])
             viewIdx = 0
             while details.has_key("View%s" % viewIdx):
                 paths = details["View%s" % viewIdx].split(" ")
-- 
1.7.1
Next: Jeff King
Message 1 of 6 in “Put quotes around branch names to prevent special characters from being interpreted by the shell.”
  1. Put quotes around branch names to prevent special characters from being interpreted by the shell.Benjamin C Meyer, Jun 4, 2010
  2. Jeff KingJun 6, 2010
  3. Jay SoffianJun 7, 2010
  4. Ævar Arnfjörð BjarmasonJun 7, 2010
  5. Ian Ward ComfortJun 7, 2010
  6. Jeff KingJun 7, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.