{"thread":{"id":"14925","subject":"[PATCH 08/12] If the user has configured various parameters, use them.","startedAt":"2008-08-10T18:26:23Z","lastAt":"2008-08-14T22:01:29Z","messageCount":16,"participants":["Anand Kumria","Simon Hausmann","Tor Arvid Lund"],"isPatch":true,"patchVersion":1,"patchTotal":12},"messages":[{"id":"86704","messageId":"1218392795-4084-1-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":null,"subject":"[PATCH 00/12] Allow users to access Perforce repositories requiring authentication","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:23Z","receivedAt":"2008-08-10T18:26:23Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Hi,\n\nThis series of patches refactors a few function calls into git-p4\nso that they all go via the same function to build up the command\nline.\n\nIt also then allows users to specify any particular user / password\nrequired to access their Perforce repository (plus a few other parameters).\n\nI have specifically tested this agains the public Zimbra repository and\nit works for me fine. Any feedback would be welcomed.\n\nThanks,\nAnand\n\nAnand Kumria (12):\n  Create a specific version of the read_pipe_lines command for p4\n    invocations\n  Utilise the new 'p4_read_pipe_lines' command\n  Have a command that specifically invokes 'p4' (via system)\n  Utilise the new 'p4_system' function.\n  Add a single command that will be used to construct the 'p4' command\n  If we are in verbose mode, output what we are about to run (or\n    return)\n  Switch to using 'p4_build_cmd'\n  If the user has configured various parameters, use them.\n  Consistently use 'git-p4' for the configuration entries\n  Move git-p4.syncFromOrigin into a configuration parameters section\n  Put some documentation in about the parameters that have been added\n  Put in the two other configuration elements found in the source\n\n contrib/fast-import/git-p4     |   71 ++++++++++++++++++++++++++++++++-------\n contrib/fast-import/git-p4.txt |   68 +++++++++++++++++++++++++++++++-------\n 2 files changed, 114 insertions(+), 25 deletions(-)\n"},{"id":"86705","messageId":"1218392795-4084-2-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-1-git-send-email-wildfire@progsoc.org","subject":"[PATCH 01/12] Create a specific version of the read_pipe_lines command for p4 invocations","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:24Z","receivedAt":"2008-08-10T18:26:24Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" This will make it easier to isolate changes to how 'p4' is invoked\n (whether with parameters or not, etc.).\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 6ae0429..fc2a60d 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -57,6 +57,13 @@ def read_pipe_lines(c):\n \n     return val\n \n+def p4_read_pipe_lines(c):\n+    \"\"\"Specifically invoke p4 on the command supplied. \"\"\"\n+    real_cmd = \"%s %s\" % (\"p4\", c)\n+    if verbose:\n+        print real_cmd\n+    return read_pipe_lines(real_cmd)\n+\n def system(cmd):\n     if verbose:\n         sys.stderr.write(\"executing %s\\n\" % cmd)\n-- \n1.5.6.3\n"},{"id":"86707","messageId":"1218392795-4084-3-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-2-git-send-email-wildfire@progsoc.org","subject":"[PATCH 02/12] Utilise the new 'p4_read_pipe_lines' command","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:25Z","receivedAt":"2008-08-10T18:26:25Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" Now that we have the new command, we can utilise it and then\n eventually, isolate any changes required to the one place.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex fc2a60d..3deaa42 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -371,7 +371,7 @@ def originP4BranchesExist():\n \n def p4ChangesForPaths(depotPaths, changeRange):\n     assert depotPaths\n-    output = read_pipe_lines(\"p4 changes \" + ' '.join ([\"%s...%s\" % (p, changeRange)\n+    output = p4_read_pipe_lines(\"changes \" + ' '.join ([\"%s...%s\" % (p, changeRange)\n                                                         for p in depotPaths]))\n \n     changes = []\n@@ -519,7 +519,7 @@ class P4Submit(Command):\n         # remove lines in the Files section that show changes to files outside the depot path we're committing into\n         template = \"\"\n         inFilesSection = False\n-        for line in read_pipe_lines(\"p4 change -o\"):\n+        for line in p4_read_pipe_lines(\"change -o\"):\n             if line.endswith(\"\\r\\n\"):\n                 line = line[:-2] + \"\\n\"\n             if inFilesSection:\n-- \n1.5.6.3\n"},{"id":"86706","messageId":"1218392795-4084-4-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-3-git-send-email-wildfire@progsoc.org","subject":"[PATCH 03/12] Have a command that specifically invokes 'p4' (via system)","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:26Z","receivedAt":"2008-08-10T18:26:26Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" Similiar to our 'p4_read_pipe_lines' command, we can isolate\n specific changes to the invocation method in the one location\n with this change.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 3deaa42..08acd51 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -70,6 +70,13 @@ def system(cmd):\n     if os.system(cmd) != 0:\n         die(\"command failed: %s\" % cmd)\n \n+def p4_system(cmd):\n+    \"\"\"Specifically invoke p4 as the system command. \"\"\"\n+    real_cmd = \"%s %s\" % (\"p4\", cmd)\n+    if verbose:\n+        print real_cmd\n+    return system(real_cmd)\n+\n def isP4Exec(kind):\n     \"\"\"Determine if a Perforce 'kind' should have execute permission\n \n-- \n1.5.6.3\n"},{"id":"86695","messageId":"1218392795-4084-5-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-4-git-send-email-wildfire@progsoc.org","subject":"[PATCH 04/12] Utilise the new 'p4_system' function.","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:27Z","receivedAt":"2008-08-10T18:26:27Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |   18 +++++++++---------\n 1 files changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 08acd51..2ed36ec 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -98,7 +98,7 @@ def setP4ExecBit(file, mode):\n         if p4Type[-1] == \"+\":\n             p4Type = p4Type[0:-1]\n \n-    system(\"p4 reopen -t %s %s\" % (p4Type, file))\n+    p4_system(\"reopen -t %s %s\" % (p4Type, file))\n \n def getP4OpenedType(file):\n     # Returns the perforce file type for the given file.\n@@ -561,7 +561,7 @@ class P4Submit(Command):\n             modifier = diff['status']\n             path = diff['src']\n             if modifier == \"M\":\n-                system(\"p4 edit \\\"%s\\\"\" % path)\n+                p4_system(\"edit \\\"%s\\\"\" % path)\n                 if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n                     filesToChangeExecBit[path] = diff['dst_mode']\n                 editedFiles.add(path)\n@@ -576,8 +576,8 @@ class P4Submit(Command):\n                     filesToAdd.remove(path)\n             elif modifier == \"R\":\n                 src, dest = diff['src'], diff['dst']\n-                system(\"p4 integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n-                system(\"p4 edit \\\"%s\\\"\" % (dest))\n+                p4_system(\"integrate -Dt \\\"%s\\\" \\\"%s\\\"\" % (src, dest))\n+                p4_system(\"edit \\\"%s\\\"\" % (dest))\n                 if isModeExecChanged(diff['src_mode'], diff['dst_mode']):\n                     filesToChangeExecBit[dest] = diff['dst_mode']\n                 os.unlink(dest)\n@@ -601,7 +601,7 @@ class P4Submit(Command):\n             if response == \"s\":\n                 print \"Skipping! Good luck with the next patches...\"\n                 for f in editedFiles:\n-                    system(\"p4 revert \\\"%s\\\"\" % f);\n+                    p4_system(\"revert \\\"%s\\\"\" % f);\n                 for f in filesToAdd:\n                     system(\"rm %s\" %f)\n                 return\n@@ -624,10 +624,10 @@ class P4Submit(Command):\n         system(applyPatchCmd)\n \n         for f in filesToAdd:\n-            system(\"p4 add \\\"%s\\\"\" % f)\n+            p4_system(\"add \\\"%s\\\"\" % f)\n         for f in filesToDelete:\n-            system(\"p4 revert \\\"%s\\\"\" % f)\n-            system(\"p4 delete \\\"%s\\\"\" % f)\n+            p4_system(\"revert \\\"%s\\\"\" % f)\n+            p4_system(\"delete \\\"%s\\\"\" % f)\n \n         # Set/clear executable bits\n         for f in filesToChangeExecBit.keys():\n@@ -728,7 +728,7 @@ class P4Submit(Command):\n \n         os.chdir(self.clientPath)\n         print \"Syncronizing p4 checkout...\"\n-        system(\"p4 sync ...\")\n+        p4_system(\"sync ...\")\n \n         self.check()\n \n-- \n1.5.6.3\n"},{"id":"86696","messageId":"1218392795-4084-6-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-5-git-send-email-wildfire@progsoc.org","subject":"[PATCH 05/12] Add a single command that will be used to construct the 'p4' command","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:28Z","receivedAt":"2008-08-10T18:26:28Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" Rather than having three locations where the 'p4' command is built up,\n refactor this into the one place. This will, eventually, allow us to\n have one place where we modify the evironment or pass extra\n command-line options to the 'p4' binary.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |   11 +++++++++++\n 1 files changed, 11 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 2ed36ec..b4acf76 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -16,6 +16,17 @@ from sets import Set;\n \n verbose = False\n \n+\n+def p4_build_cmd(cmd):\n+    \"\"\"Build a suitable p4 command line.\n+\n+    This consolidates building and returning a p4 command line into one\n+    location. It means that hooking into the environment, or other configuration\n+    can be done more easily.\n+    \"\"\"\n+    real_cmd = \"%s %s\" % (\"p4\", cmd)\n+    return real_cmd\n+\n def die(msg):\n     if verbose:\n         raise Exception(msg)\n-- \n1.5.6.3\n"},{"id":"86697","messageId":"1218392795-4084-7-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-6-git-send-email-wildfire@progsoc.org","subject":"[PATCH 06/12] If we are in verbose mode, output what we are about to run (or return)","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:29Z","receivedAt":"2008-08-10T18:26:29Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex b4acf76..d36b0c6 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -25,6 +25,8 @@ def p4_build_cmd(cmd):\n     can be done more easily.\n     \"\"\"\n     real_cmd = \"%s %s\" % (\"p4\", cmd)\n+    if verbose:\n+        print real_cmd\n     return real_cmd\n \n def die(msg):\n-- \n1.5.6.3\n"},{"id":"86698","messageId":"1218392795-4084-8-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-7-git-send-email-wildfire@progsoc.org","subject":"[PATCH 07/12] Switch to using 'p4_build_cmd'","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:30Z","receivedAt":"2008-08-10T18:26:30Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |   10 +++-------\n 1 files changed, 3 insertions(+), 7 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex d36b0c6..2b6ea74 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -72,9 +72,7 @@ def read_pipe_lines(c):\n \n def p4_read_pipe_lines(c):\n     \"\"\"Specifically invoke p4 on the command supplied. \"\"\"\n-    real_cmd = \"%s %s\" % (\"p4\", c)\n-    if verbose:\n-        print real_cmd\n+    real_cmd = p4_build_cmd(c)\n     return read_pipe_lines(real_cmd)\n \n def system(cmd):\n@@ -85,9 +83,7 @@ def system(cmd):\n \n def p4_system(cmd):\n     \"\"\"Specifically invoke p4 as the system command. \"\"\"\n-    real_cmd = \"%s %s\" % (\"p4\", cmd)\n-    if verbose:\n-        print real_cmd\n+    real_cmd = p4_build_cmd(cmd)\n     return system(real_cmd)\n \n def isP4Exec(kind):\n@@ -172,7 +168,7 @@ def isModeExecChanged(src_mode, dst_mode):\n     return isModeExec(src_mode) != isModeExec(dst_mode)\n \n def p4CmdList(cmd, stdin=None, stdin_mode='w+b'):\n-    cmd = \"p4 -G %s\" % cmd\n+    cmd = p4_build_cmd(\"-G %s\" % (cmd))\n     if verbose:\n         sys.stderr.write(\"Opening pipe: %s\\n\" % cmd)\n \n-- \n1.5.6.3\n"},{"id":"86694","messageId":"1218392795-4084-9-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-8-git-send-email-wildfire@progsoc.org","subject":"[PATCH 08/12] If the user has configured various parameters, use them.","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:31Z","receivedAt":"2008-08-10T18:26:31Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" Some repositories require authentication and access to certain\n hosts. Allow git-p4 to pull this information from the configuration\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |   24 +++++++++++++++++++++++-\n 1 files changed, 23 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 2b6ea74..a927e50 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -24,7 +24,29 @@ def p4_build_cmd(cmd):\n     location. It means that hooking into the environment, or other configuration\n     can be done more easily.\n     \"\"\"\n-    real_cmd = \"%s %s\" % (\"p4\", cmd)\n+    real_cmd = \"%s \" % \"p4\"\n+\n+    user = gitConfig(\"git-p4.user\")\n+    if len(user) > 0:\n+        real_cmd += \"-u %s \" % user\n+\n+    password = gitConfig(\"git-p4.password\")\n+    if len(password) > 0:\n+        real_cmd += \"-P %s \" % password\n+\n+    port = gitConfig(\"git-p4.port\")\n+    if len(port) > 0:\n+        real_cmd += \"-p %s \" % port\n+\n+    host = gitConfig(\"git-p4.host\")\n+    if len(host) > 0:\n+        real_cmd += \"-h %s \" % host\n+\n+    client = gitConfig(\"git-p4.client\")\n+    if len(client) > 0:\n+        real_cmd += \"-c %s \" % client\n+\n+    real_cmd += \"%s\" % (cmd)\n     if verbose:\n         print real_cmd\n     return real_cmd\n-- \n1.5.6.3\n"},{"id":"86699","messageId":"1218392795-4084-10-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-9-git-send-email-wildfire@progsoc.org","subject":"[PATCH 09/12] Consistently use 'git-p4' for the configuration entries","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:32Z","receivedAt":"2008-08-10T18:26:32Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4 |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex a927e50..6c64224 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -1444,7 +1444,7 @@ class P4Sync(Command):\n             if not gitBranchExists(self.refPrefix + \"HEAD\") and self.importIntoRemotes and gitBranchExists(self.branch):\n                 system(\"git symbolic-ref %sHEAD %s\" % (self.refPrefix, self.branch))\n \n-        if self.useClientSpec or gitConfig(\"p4.useclientspec\") == \"true\":\n+        if self.useClientSpec or gitConfig(\"git-p4.useclientspec\") == \"true\":\n             self.getClientSpec()\n \n         # TODO: should always look at previous commits,\n-- \n1.5.6.3\n"},{"id":"86700","messageId":"1218392795-4084-11-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-10-git-send-email-wildfire@progsoc.org","subject":"[PATCH 10/12] Move git-p4.syncFromOrigin into a configuration parameters section","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:33Z","receivedAt":"2008-08-10T18:26:33Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4.txt |   28 ++++++++++++++++------------\n 1 files changed, 16 insertions(+), 12 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt\nindex b16a838..0896abb 100644\n--- a/contrib/fast-import/git-p4.txt\n+++ b/contrib/fast-import/git-p4.txt\n@@ -63,18 +63,6 @@ It is recommended to run 'git repack -a -d -f' from time to time when using\n incremental imports to optimally combine the individual git packs that each\n incremental import creates through the use of git-fast-import.\n \n-\n-A useful setup may be that you have a periodically updated git repository\n-somewhere that contains a complete import of a Perforce project. That git\n-repository can be used to clone the working repository from and one would\n-import from Perforce directly after cloning using git-p4. If the connection to\n-the Perforce server is slow and the working repository hasn't been synced for a\n-while it may be desirable to fetch changes from the origin git repository using\n-the efficient git protocol. git-p4 supports this setup by calling \"git fetch origin\"\n-by default if there is an origin branch. You can disable this using\n-\n-  git config git-p4.syncFromOrigin false\n-\n Updating\n ========\n \n@@ -140,6 +128,22 @@ Example\n   git-p4 rebase\n \n \n+Configuration parameters\n+========================\n+\n+git-p4.syncFromOrigin\n+\n+A useful setup may be that you have a periodically updated git repository\n+somewhere that contains a complete import of a Perforce project. That git\n+repository can be used to clone the working repository from and one would\n+import from Perforce directly after cloning using git-p4. If the connection to\n+the Perforce server is slow and the working repository hasn't been synced for a\n+while it may be desirable to fetch changes from the origin git repository using\n+the efficient git protocol. git-p4 supports this setup by calling \"git fetch origin\"\n+by default if there is an origin branch. You can disable this using:\n+\n+  git config [--global] git-p4.syncFromOrigin false\n+\n Implementation Details...\n =========================\n \n-- \n1.5.6.3\n"},{"id":"86701","messageId":"1218392795-4084-12-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-11-git-send-email-wildfire@progsoc.org","subject":"[PATCH 11/12] Put some documentation in about the parameters that have been added","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:34Z","receivedAt":"2008-08-10T18:26:34Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"Signed-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4.txt |   32 ++++++++++++++++++++++++++++++++\n 1 files changed, 32 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt\nindex 0896abb..79a22e9 100644\n--- a/contrib/fast-import/git-p4.txt\n+++ b/contrib/fast-import/git-p4.txt\n@@ -131,6 +131,38 @@ Example\n Configuration parameters\n ========================\n \n+git-p4.user ($P4USER)\n+\n+Allows you to specify the username to use to connect to the Perforce repository.\n+\n+  git config [--global] git-p4.user public\n+\n+git-p4.password ($P4PASS)\n+\n+Allows you to specify the password to use to connect to the Perforce repository.\n+Warning this password will be visible on the command-line invocation of the p4 binary.\n+\n+  git config [--global] git-p4.password public1234\n+\n+git-p4.port ($P4PORT)\n+\n+Specify the port to be used to contact the Perforce server. As this will be passed\n+directly to the p4 binary, it may be in the format host:port as well.\n+\n+  git config [--global] git-p4.port codes.zimbra.com:2666\n+\n+git-p4.host ($P4HOST)\n+\n+Specify the host to contact for a Perforce repository.\n+\n+  git config [--global] git-p4.host perforce.example.com\n+\n+git-p4.client ($P4CLIENT)\n+\n+Specify the client name to use\n+\n+  git config [--global] git-p4.client public-view\n+\n git-p4.syncFromOrigin\n \n A useful setup may be that you have a periodically updated git repository\n-- \n1.5.6.3\n"},{"id":"86702","messageId":"1218392795-4084-13-git-send-email-wildfire@progsoc.org","threadId":"14925","inReplyTo":"1218392795-4084-12-git-send-email-wildfire@progsoc.org","subject":"[PATCH 12/12] Put in the two other configuration elements found in the source","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-10T18:26:35Z","receivedAt":"2008-08-10T18:26:35Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":" I am not entirely clear what these parameters do but felt it\n useful to call them out in the documentation.\n\nSigned-off-by: Anand Kumria <wildfire@progsoc.org>\n---\n contrib/fast-import/git-p4.txt |    8 ++++++++\n 1 files changed, 8 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/fast-import/git-p4.txt b/contrib/fast-import/git-p4.txt\nindex 79a22e9..ac551d4 100644\n--- a/contrib/fast-import/git-p4.txt\n+++ b/contrib/fast-import/git-p4.txt\n@@ -163,6 +163,10 @@ Specify the client name to use\n \n   git config [--global] git-p4.client public-view\n \n+git-p4.allowSubmit\n+\n+  git config [--global] git-p4.allowSubmit false\n+\n git-p4.syncFromOrigin\n \n A useful setup may be that you have a periodically updated git repository\n@@ -176,6 +180,10 @@ by default if there is an origin branch. You can disable this using:\n \n   git config [--global] git-p4.syncFromOrigin false\n \n+git-p4.useclientspec\n+\n+  git config [--global] git-p4.useclientspec false\n+\n Implementation Details...\n =========================\n \n-- \n1.5.6.3\n"},{"id":"87088","messageId":"200808132147.55119.simon@lst.de","threadId":"14925","inReplyTo":"1218392795-4084-1-git-send-email-wildfire@progsoc.org","subject":"Re: [PATCH 00/12] Allow users to access Perforce repositories requiring authentication","fromName":"Simon Hausmann","fromEmail":"simon@lst.de","sentAt":"2008-08-13T19:47:41Z","receivedAt":"2008-08-13T19:47:41Z","isPatch":true,"sender":{"key":"hausmann@kde.org","avatar":"https://gravatar.com/avatar/bc9aad4fb31dce17eb66e690e7b51fe980c62da3c225c785da35dd806b8da778?d=mp&s=160"},"body":"Hi,\n\nOn Sunday 10 August 2008 20:26:23 Anand Kumria wrote:\n> Hi,\n>\n> This series of patches refactors a few function calls into git-p4\n> so that they all go via the same function to build up the command\n> line.\n>\n> It also then allows users to specify any particular user / password\n> required to access their Perforce repository (plus a few other parameters).\n>\n> I have specifically tested this agains the public Zimbra repository and\n> it works for me fine. Any feedback would be welcomed.\n\nJunio, I saw that you queued up this series in pu as ak/p4. I looked through \nthe patches and I think they look great. I suggest to include them into master \nafter 1.6.0.\n\nAnand, great work :)\n\n\nSimon\n"},{"id":"87203","messageId":"1a6be5fa0808141000w78b54bc2x1262b814f36ecdd6@mail.gmail.com","threadId":"14925","inReplyTo":"1218392795-4084-1-git-send-email-wildfire@progsoc.org","subject":"Re: [PATCH 00/12] Allow users to access Perforce repositories requiring authentication","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2008-08-14T17:00:12Z","receivedAt":"2008-08-14T17:00:12Z","isPatch":true,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"Hi,\n\nOn Sun, Aug 10, 2008 at 8:26 PM, Anand Kumria <wildfire@progsoc.org> wrote:\n> Hi,\n>\n> This series of patches refactors a few function calls into git-p4\n> so that they all go via the same function to build up the command\n> line.\n>\n> It also then allows users to specify any particular user / password\n> required to access their Perforce repository (plus a few other parameters).\n>\n> I have specifically tested this agains the public Zimbra repository and\n> it works for me fine. Any feedback would be welcomed.\n\nI had an issue when using git p4 submit, and I had newly added files\nin the changelist. This, I think, is caused by a call to \"p4 opened\"\nthat was not converted to use your new p4_build_cmd function. So I\ndon't think your patches should be merged to master before this is\nfixed. However, when applying the simple diff below, this works for\nme.\n\nOtherwise, I think your patch series were very nice, since I often use\ndifferent perforce servers. Btw, my diff works correctly, I think, but\nit is probably nicer to wrap read_pipe inside a p4_read_pipe - similar\nto what you did with p4_read_pipe_lines. All in all: good work! :)\n\n-Tor Arvid-\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 6c64224..8705ec9 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -134,7 +134,8 @@ def setP4ExecBit(file, mode):\n def getP4OpenedType(file):\n     # Returns the perforce file type for the given file.\n\n-    result = read_pipe(\"p4 opened %s\" % file)\n+    real_cmd = p4_build_cmd(\"opened %s\" % file)\n+    result = read_pipe(real_cmd)\n     match = re.match(\".*\\((.+)\\)\\r?$\", result)\n     if match:\n         return match.group(1)\n"},{"id":"87242","messageId":"g829vo$q9j$2@ger.gmane.org","threadId":"14925","inReplyTo":"1a6be5fa0808141000w78b54bc2x1262b814f36ecdd6@mail.gmail.com","subject":"Re: [PATCH 00/12] Allow users to access Perforce repositories requiring authentication","fromName":"Anand Kumria","fromEmail":"wildfire@progsoc.org","sentAt":"2008-08-14T22:01:29Z","receivedAt":"2008-08-14T22:01:29Z","isPatch":true,"sender":{"key":"wildfire@progsoc.org","avatar":null},"body":"\nHi Tor,\n\nOn Thu, 14 Aug 2008 19:00:12 +0200, Tor Arvid Lund wrote:\n\n> I had an issue when using git p4 submit, and I had newly added files in\n> the changelist. This, I think, is caused by a call to \"p4 opened\" that\n> was not converted to use your new p4_build_cmd function. So I don't\n> think your patches should be merged to master before this is fixed.\n> However, when applying the simple diff below, this works for me.\n\nThanks for catching this. I found a few other occurances similar to the \none you mentioned. I will send out an updated patch momentarily.\n\nThanks,\nAnand\n"}]}