{"thread":{"id":"31229","subject":"git-p4 migrates perforce “main” branch into git branches as subdirectories (doubled code in git branches)","startedAt":"2012-08-10T19:14:58Z","lastAt":"2012-08-12T19:30:57Z","messageCount":10,"participants":["Matthew Korich","Pete Wyckoff","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"196824","messageId":"CANWnr5aqswATTM9_Zyw=w_x01=e8CqoCsn0Ybee0XvGSJ3F_yw@mail.gmail.com","threadId":"31229","inReplyTo":null,"subject":"git-p4 migrates perforce “main” branch into git branches as subdirectories (doubled code in git branches)","fromName":"Matthew Korich","fromEmail":"matthew@korich.net","sentAt":"2012-08-10T19:14:58Z","receivedAt":"2012-08-10T19:14:58Z","isPatch":false,"sender":{"key":"matthew@korich.net","avatar":null},"body":"Using git p4 on git version 1.7.12.rc2 has path issues. Standard\nclone/sync ops apparently place detected master and branches on\nindependent and parallel directory structures instead of git branches.\nSee http://stackoverflow.com/q/11893688/1588831 for a full demo of the problem.\nThanks,\n-Matt Korich\n"},{"id":"196863","messageId":"20120811165143.GA2004@padd.com","threadId":"31229","inReplyTo":"CANWnr5aqswATTM9_Zyw=w_x01=e8CqoCsn0Ybee0XvGSJ3F_yw@mail.gmail.com","subject":"[PATCH 0/5] git p4: fix branch detection with --use-client-spec","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:51:43Z","receivedAt":"2012-08-11T16:51:43Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"matthew@korich.net wrote on Fri, 10 Aug 2012 12:14 -0700:\n> Using git p4 on git version 1.7.12.rc2 has path issues. Standard\n> clone/sync ops apparently place detected master and branches on\n> independent and parallel directory structures instead of git branches.\n> See http://stackoverflow.com/q/11893688/1588831 for a full demo of the problem.\n\nThank you for the detailed report.  It is a bug in 1.7.12-rc2.\nThis series fixes it, on top of origin/master.\n\nThe crux of the matter is that files are mapped into the wrong\nlocations in git when both --use-client-spec and --branch-detection\nare enabled.\n\nPete Wyckoff (5):\n  git p4 test: move client_view() function to library\n  git p4 test: add broken --use-client-spec --detect-branches tests\n  git p4: set self.branchPrefixes in initialization\n  git p4: do wildcard decoding in stripRepoPath\n  git p4: make branch detection work with --use-client-spec\n\n git-p4.py                     | 75 +++++++++++++++++++++++++++--------------\n t/lib-git-p4.sh               | 18 ++++++++++\n t/t9801-git-p4-branch.sh      | 77 +++++++++++++++++++++++++++++++++++++++++++\n t/t9809-git-p4-client-view.sh | 17 ----------\n 4 files changed, 146 insertions(+), 41 deletions(-)\n\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196864","messageId":"1344704104-17727-1-git-send-email-pw@padd.com","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"[PATCH 1/5] git p4 test: move client_view() function to library","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:55:00Z","receivedAt":"2012-08-11T16:55:00Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"This code will be useful in --detect-branches --use-client-spec tests.\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n t/lib-git-p4.sh               | 18 ++++++++++++++++++\n t/t9809-git-p4-client-view.sh | 17 -----------------\n 2 files changed, 18 insertions(+), 17 deletions(-)\n\ndiff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh\nindex 2d753ab..5c952d6 100644\n--- a/t/lib-git-p4.sh\n+++ b/t/lib-git-p4.sh\n@@ -115,3 +115,21 @@ marshal_dump() {\n \tEOF\n \t\"$PYTHON_PATH\" \"$TRASH_DIRECTORY/marshal-dump.py\"\n }\n+\n+#\n+# Construct a client with this list of View lines\n+#\n+client_view() {\n+\t(\n+\t\tcat <<-EOF &&\n+\t\tClient: client\n+\t\tDescription: client\n+\t\tRoot: $cli\n+\t\tView:\n+\t\tEOF\n+\t\tfor arg ; do\n+\t\t\tprintf \"\\t$arg\\n\"\n+\t\tdone\n+\t) | p4 client -i\n+}\n+\ndiff --git a/t/t9809-git-p4-client-view.sh b/t/t9809-git-p4-client-view.sh\nindex 7d993ef..281be29 100755\n--- a/t/t9809-git-p4-client-view.sh\n+++ b/t/t9809-git-p4-client-view.sh\n@@ -9,23 +9,6 @@ test_expect_success 'start p4d' '\n '\n \n #\n-# Construct a client with this list of View lines\n-#\n-client_view() {\n-\t(\n-\t\tcat <<-EOF &&\n-\t\tClient: client\n-\t\tDescription: client\n-\t\tRoot: $cli\n-\t\tView:\n-\t\tEOF\n-\t\tfor arg ; do\n-\t\t\tprintf \"\\t$arg\\n\"\n-\t\tdone\n-\t) | p4 client -i\n-}\n-\n-#\n # Verify these files exist, exactly.  Caller creates\n # a list of files in file \"files\".\n #\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196865","messageId":"1344704104-17727-2-git-send-email-pw@padd.com","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"[PATCH 2/5] git p4 test: add broken --use-client-spec --detect-branches tests","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:55:01Z","receivedAt":"2012-08-11T16:55:01Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n t/t9801-git-p4-branch.sh | 77 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 77 insertions(+)\n\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex 99fe16b..ca3a7f9 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -410,6 +410,83 @@ test_expect_failure 'git p4 clone file subset branch' '\n \t\ttest_path_is_missing file3\n \t)\n '\n+\n+# From a report in http://stackoverflow.com/questions/11893688\n+# where --use-client-spec caused branch prefixes not to be removed;\n+# every file in git appeared into a subdirectory of the branch name.\n+test_expect_success 'use-client-spec detect-branches setup' '\n+\trm -rf \"$cli\" &&\n+\tmkdir \"$cli\" &&\n+\t(\n+\t\tcd \"$cli\" &&\n+\t\tclient_view \"//depot/usecs/... //client/...\" &&\n+\t\tmkdir b1 &&\n+\t\techo b1/b1-file1 >b1/b1-file1 &&\n+\t\tp4 add b1/b1-file1 &&\n+\t\tp4 submit -d \"b1/b1-file1\" &&\n+\n+\t\tp4 integrate //depot/usecs/b1/... //depot/usecs/b2/... &&\n+\t\tp4 submit -d \"b1 -> b2\" &&\n+\t\tp4 branch -i <<-EOF &&\n+\t\tBranch: b2\n+\t\tView: //depot/usecs/b1/... //depot/usecs/b2/...\n+\t\tEOF\n+\n+\t\techo b2/b2-file2 >b2/b2-file2 &&\n+\t\tp4 add b2/b2-file2 &&\n+\t\tp4 submit -d \"b2/b2-file2\"\n+\t)\n+'\n+\n+test_expect_failure 'use-client-spec detect-branches files in top-level' '\n+\ttest_when_finished cleanup_git &&\n+\ttest_create_repo \"$git\" &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit p4 sync --detect-branches --use-client-spec //depot/usecs@all &&\n+\t\tgit checkout -b master p4/usecs/b1 &&\n+\t\ttest_path_is_file b1-file1 &&\n+\t\ttest_path_is_missing b2-file2 &&\n+\t\ttest_path_is_missing b1 &&\n+\t\ttest_path_is_missing b2 &&\n+\n+\t\tgit checkout -b b2 p4/usecs/b2 &&\n+\t\ttest_path_is_file b1-file1 &&\n+\t\ttest_path_is_file b2-file2 &&\n+\t\ttest_path_is_missing b1 &&\n+\t\ttest_path_is_missing b2\n+\t)\n+'\n+\n+test_expect_success 'use-client-spec detect-branches skips branches setup' '\n+\t(\n+\t\tcd \"$cli\" &&\n+\n+\t\tp4 integrate //depot/usecs/b1/... //depot/usecs/b3/... &&\n+\t\tp4 submit -d \"b1 -> b3\" &&\n+\t\tp4 branch -i <<-EOF &&\n+\t\tBranch: b3\n+\t\tView: //depot/usecs/b1/... //depot/usecs/b3/...\n+\t\tEOF\n+\n+\t\techo b3/b3-file3 >b3/b3-file3 &&\n+\t\tp4 add b3/b3-file3 &&\n+\t\tp4 submit -d \"b3/b3-file3\"\n+\t)\n+'\n+\n+test_expect_success 'use-client-spec detect-branches skips branches' '\n+\tclient_view \"//depot/usecs/... //client/...\" \\\n+\t            \"-//depot/usecs/b3/... //client/b3/...\" &&\n+\ttest_when_finished cleanup_git &&\n+\ttest_create_repo \"$git\" &&\n+\t(\n+\t\tcd \"$git\" &&\n+\t\tgit p4 sync --detect-branches --use-client-spec //depot/usecs@all &&\n+\t\ttest_must_fail git rev-parse refs/remotes/p4/usecs/b3\n+\t)\n+'\n+\n test_expect_success 'kill p4d' '\n \tkill_p4d\n '\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196866","messageId":"1344704104-17727-3-git-send-email-pw@padd.com","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"[PATCH 3/5] git p4: set self.branchPrefixes in initialization","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:55:02Z","receivedAt":"2012-08-11T16:55:02Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"This instance variable is needed during commit() to map\nfiles from p4 to their relative locations in git.  Set\nit when initializing P4Sync to avoid passing it to every\ncommit() call.\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n git-p4.py | 25 ++++++++++++++-----------\n 1 file changed, 14 insertions(+), 11 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex e67d37d..6d07115 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -2041,10 +2041,9 @@ class P4Sync(Command, P4UserMap):\n         gitStream.write(description)\n         gitStream.write(\"\\n\")\n \n-    def commit(self, details, files, branch, branchPrefixes, parent = \"\"):\n+    def commit(self, details, files, branch, parent = \"\"):\n         epoch = details[\"time\"]\n         author = details[\"user\"]\n-        self.branchPrefixes = branchPrefixes\n \n         if self.verbose:\n             print \"commit into %s\" % branch\n@@ -2053,7 +2052,7 @@ class P4Sync(Command, P4UserMap):\n         # create a commit.\n         new_files = []\n         for f in files:\n-            if [p for p in branchPrefixes if p4PathStartsWith(f['path'], p)]:\n+            if [p for p in self.branchPrefixes if p4PathStartsWith(f['path'], p)]:\n                 new_files.append (f)\n             else:\n                 sys.stderr.write(\"Ignoring file outside of prefix: %s\\n\" % f['path'])\n@@ -2070,8 +2069,8 @@ class P4Sync(Command, P4UserMap):\n \n         self.gitStream.write(\"data <<EOT\\n\")\n         self.gitStream.write(details[\"desc\"])\n-        self.gitStream.write(\"\\n[git-p4: depot-paths = \\\"%s\\\": change = %s\"\n-                             % (','.join (branchPrefixes), details[\"change\"]))\n+        self.gitStream.write(\"\\n[git-p4: depot-paths = \\\"%s\\\": change = %s\" %\n+                             (','.join(self.branchPrefixes), details[\"change\"]))\n         if len(details['options']) > 0:\n             self.gitStream.write(\": options = %s\" % details['options'])\n         self.gitStream.write(\"]\\nEOT\\n\\n\")\n@@ -2094,7 +2093,7 @@ class P4Sync(Command, P4UserMap):\n                 print \"Change %s is labelled %s\" % (change, labelDetails)\n \n             files = p4CmdList([\"files\"] + [\"%s...@%s\" % (p, change)\n-                                                    for p in branchPrefixes])\n+                                                for p in self.branchPrefixes])\n \n             if len(files) == len(labelRevisions):\n \n@@ -2405,6 +2404,7 @@ class P4Sync(Command, P4UserMap):\n                     for branch in branches.keys():\n                         ## HACK  --hwn\n                         branchPrefix = self.depotPaths[0] + branch + \"/\"\n+                        self.branchPrefixes = [ branchPrefix ]\n \n                         parent = \"\"\n \n@@ -2449,19 +2449,19 @@ class P4Sync(Command, P4UserMap):\n                             tempBranch = os.path.join(self.tempBranchLocation, \"%d\" % (change))\n                             if self.verbose:\n                                 print \"Creating temporary branch: \" + tempBranch\n-                            self.commit(description, filesForCommit, tempBranch, [branchPrefix])\n+                            self.commit(description, filesForCommit, tempBranch)\n                             self.tempBranches.append(tempBranch)\n                             self.checkpoint()\n                             blob = self.searchParent(parent, branch, tempBranch)\n                         if blob:\n-                            self.commit(description, filesForCommit, branch, [branchPrefix], blob)\n+                            self.commit(description, filesForCommit, branch, blob)\n                         else:\n                             if self.verbose:\n                                 print \"Parent of %s not found. Committing into head of %s\" % (branch, parent)\n-                            self.commit(description, filesForCommit, branch, [branchPrefix], parent)\n+                            self.commit(description, filesForCommit, branch, parent)\n                 else:\n                     files = self.extractFilesFromCommit(description)\n-                    self.commit(description, files, self.branch, self.depotPaths,\n+                    self.commit(description, files, self.branch,\n                                 self.initialParent)\n                     self.initialParent = \"\"\n             except IOError:\n@@ -2525,7 +2525,7 @@ class P4Sync(Command, P4UserMap):\n \n         self.updateOptionDict(details)\n         try:\n-            self.commit(details, self.extractFilesFromCommit(details), self.branch, self.depotPaths)\n+            self.commit(details, self.extractFilesFromCommit(details), self.branch)\n         except IOError:\n             print \"IO error with git fast-import. Is your git version recent enough?\"\n             print self.gitError.read()\n@@ -2683,6 +2683,9 @@ class P4Sync(Command, P4UserMap):\n \n         self.depotPaths = newPaths\n \n+        # --detect-branches may change this for each branch\n+        self.branchPrefixes = self.depotPaths\n+\n         self.loadUserMapFromCache()\n         self.labels = {}\n         if self.detectLabels:\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196867","messageId":"1344704104-17727-4-git-send-email-pw@padd.com","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"[PATCH 4/5] git p4: do wildcard decoding in stripRepoPath","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:55:03Z","receivedAt":"2012-08-11T16:55:03Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"Instead of having to remember to do it after each call to\nstripRepoPath, make it part of that function.\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n git-p4.py | 17 ++++++++---------\n 1 file changed, 8 insertions(+), 9 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex 6d07115..e20ff5d 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1819,15 +1819,17 @@ class P4Sync(Command, P4UserMap):\n \n     def stripRepoPath(self, path, prefixes):\n         if self.useClientSpec:\n-            return self.clientSpecDirs.map_in_client(path)\n+            path = self.clientSpecDirs.map_in_client(path)\n \n-        if self.keepRepoPath:\n-            prefixes = [re.sub(\"^(//[^/]+/).*\", r'\\1', prefixes[0])]\n+        else:\n+            if self.keepRepoPath:\n+                prefixes = [re.sub(\"^(//[^/]+/).*\", r'\\1', prefixes[0])]\n \n-        for p in prefixes:\n-            if p4PathStartsWith(path, p):\n-                path = path[len(p):]\n+            for p in prefixes:\n+                if p4PathStartsWith(path, p):\n+                    path = path[len(p):]\n \n+        path = wildcard_decode(path)\n         return path\n \n     def splitFilesIntoBranches(self, commit):\n@@ -1849,7 +1851,6 @@ class P4Sync(Command, P4UserMap):\n             fnum = fnum + 1\n \n             relPath = self.stripRepoPath(path, self.depotPaths)\n-            relPath = wildcard_decode(relPath)\n \n             for branch in self.knownBranches.keys():\n \n@@ -1867,7 +1868,6 @@ class P4Sync(Command, P4UserMap):\n \n     def streamOneP4File(self, file, contents):\n         relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)\n-        relPath = wildcard_decode(relPath)\n         if verbose:\n             sys.stderr.write(\"%s\\n\" % relPath)\n \n@@ -1936,7 +1936,6 @@ class P4Sync(Command, P4UserMap):\n \n     def streamOneP4Deletion(self, file):\n         relPath = self.stripRepoPath(file['path'], self.branchPrefixes)\n-        relPath = wildcard_decode(relPath)\n         if verbose:\n             sys.stderr.write(\"delete %s\\n\" % relPath)\n         self.gitStream.write(\"D %s\\n\" % relPath)\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196868","messageId":"1344704104-17727-5-git-send-email-pw@padd.com","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"[PATCH 5/5] git p4: make branch detection work with --use-client-spec","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-11T16:55:04Z","receivedAt":"2012-08-11T16:55:04Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"The bug report in http://stackoverflow.com/questions/11893688\nobserves that files are mapped into the wrong locations in\ngit when both --use-client-spec and --branch-detection are enabled.\n\nFix this by changing the relative path prefix to match discovered\nbranches when using a client spec.\n\nThe problem was likely introduced with ecb7cf9 (git-p4: rewrite view\nhandling, 2012-01-02).\n\nSigned-off-by: Pete Wyckoff <pw@padd.com>\n---\n git-p4.py                | 37 +++++++++++++++++++++++++++++++------\n t/t9801-git-p4-branch.sh |  2 +-\n 2 files changed, 32 insertions(+), 7 deletions(-)\n\ndiff --git a/git-p4.py b/git-p4.py\nindex e20ff5d..aed1a2d 100755\n--- a/git-p4.py\n+++ b/git-p4.py\n@@ -1818,21 +1818,41 @@ class P4Sync(Command, P4UserMap):\n         return files\n \n     def stripRepoPath(self, path, prefixes):\n+        \"\"\"When streaming files, this is called to map a p4 depot path\n+           to where it should go in git.  The prefixes are either\n+           self.depotPaths, or self.branchPrefixes in the case of\n+           branch detection.\"\"\"\n+\n         if self.useClientSpec:\n+            # branch detection moves files up a level (the branch name)\n+            # from what client spec interpretation gives\n             path = self.clientSpecDirs.map_in_client(path)\n+            if self.detectBranches:\n+                for b in self.knownBranches:\n+                    if path.startswith(b + \"/\"):\n+                        path = path[len(b)+1:]\n+\n+        elif self.keepRepoPath:\n+            # Preserve everything in relative path name except leading\n+            # //depot/; just look at first prefix as they all should\n+            # be in the same depot.\n+            depot = re.sub(\"^(//[^/]+/).*\", r'\\1', prefixes[0])\n+            if p4PathStartsWith(path, depot):\n+                path = path[len(depot):]\n \n         else:\n-            if self.keepRepoPath:\n-                prefixes = [re.sub(\"^(//[^/]+/).*\", r'\\1', prefixes[0])]\n-\n             for p in prefixes:\n                 if p4PathStartsWith(path, p):\n                     path = path[len(p):]\n+                    break\n \n         path = wildcard_decode(path)\n         return path\n \n     def splitFilesIntoBranches(self, commit):\n+        \"\"\"Look at each depotFile in the commit to figure out to what\n+           branch it belongs.\"\"\"\n+\n         branches = {}\n         fnum = 0\n         while commit.has_key(\"depotFile%s\" % fnum):\n@@ -1850,11 +1870,16 @@ class P4Sync(Command, P4UserMap):\n             file[\"type\"] = commit[\"type%s\" % fnum]\n             fnum = fnum + 1\n \n-            relPath = self.stripRepoPath(path, self.depotPaths)\n+            # start with the full relative path where this file would\n+            # go in a p4 client\n+            if self.useClientSpec:\n+                relPath = self.clientSpecDirs.map_in_client(path)\n+            else:\n+                relPath = self.stripRepoPath(path, self.depotPaths)\n \n             for branch in self.knownBranches.keys():\n-\n-                # add a trailing slash so that a commit into qt/4.2foo doesn't end up in qt/4.2\n+                # add a trailing slash so that a commit into qt/4.2foo\n+                # doesn't end up in qt/4.2, e.g.\n                 if relPath.startswith(branch + \"/\"):\n                     if branch not in branches:\n                         branches[branch] = []\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex ca3a7f9..c5f0977 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -438,7 +438,7 @@ test_expect_success 'use-client-spec detect-branches setup' '\n \t)\n '\n \n-test_expect_failure 'use-client-spec detect-branches files in top-level' '\n+test_expect_success 'use-client-spec detect-branches files in top-level' '\n \ttest_when_finished cleanup_git &&\n \ttest_create_repo \"$git\" &&\n \t(\n-- \n1.7.12.rc2.24.gc304662\n"},{"id":"196878","messageId":"7v4no8hgc0.fsf@alter.siamese.dyndns.org","threadId":"31229","inReplyTo":"20120811165143.GA2004@padd.com","subject":"Re: [PATCH 0/5] git p4: fix branch detection with --use-client-spec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-12T04:41:51Z","receivedAt":"2012-08-12T04:41:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pete Wyckoff <pw@padd.com> writes:\n\n> matthew@korich.net wrote on Fri, 10 Aug 2012 12:14 -0700:\n>> Using git p4 on git version 1.7.12.rc2 has path issues. Standard\n>> clone/sync ops apparently place detected master and branches on\n>> independent and parallel directory structures instead of git branches.\n>> See http://stackoverflow.com/q/11893688/1588831 for a full demo of the problem.\n>\n> Thank you for the detailed report.  It is a bug in 1.7.12-rc2.\n\nDo you mean \"a feature that was present in 1.7.11 without this bug\nwas broken when used with 1.7.12-rc2\"?  Or do you mean \"this bug\nexists in 1.7.12-rc2 (older versions may or may not have it, but I\nam stressing that it is not fixed)\"?\n\nThe description for [PATCH 5/5] blames v1.7.9-rc0~4^2~1, which tells\nme it is the latter.  And if that were the case, and if this were in\nthe area of the system I oversee, I wouldn't push it to the upcoming\nrelease at this late in the cycle, when I do not know what other\nthings it might break while fixing this bug (in other words, a fix\nto an old bug is not an execuse to introduce a regression).\n\nBut git-p4 is not in my area, so if you meant this should go in the\nupcoming 1.7.12 release, I'll queue them directly on 'master'.\n\nPlease tell me what your preference is.\n\nThanks.\n\n> This series fixes it, on top of origin/master.\n>\n> The crux of the matter is that files are mapped into the wrong\n> locations in git when both --use-client-spec and --branch-detection\n> are enabled.\n>\n> Pete Wyckoff (5):\n>   git p4 test: move client_view() function to library\n>   git p4 test: add broken --use-client-spec --detect-branches tests\n>   git p4: set self.branchPrefixes in initialization\n>   git p4: do wildcard decoding in stripRepoPath\n>   git p4: make branch detection work with --use-client-spec\n>\n>  git-p4.py                     | 75 +++++++++++++++++++++++++++--------------\n>  t/lib-git-p4.sh               | 18 ++++++++++\n>  t/t9801-git-p4-branch.sh      | 77 +++++++++++++++++++++++++++++++++++++++++++\n>  t/t9809-git-p4-client-view.sh | 17 ----------\n>  4 files changed, 146 insertions(+), 41 deletions(-)\n"},{"id":"196883","messageId":"20120812140449.GA5635@padd.com","threadId":"31229","inReplyTo":"7v4no8hgc0.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 0/5] git p4: fix branch detection with --use-client-spec","fromName":"Pete Wyckoff","fromEmail":"pw@padd.com","sentAt":"2012-08-12T14:04:49Z","receivedAt":"2012-08-12T14:04:49Z","isPatch":true,"sender":{"key":"pw@padd.com","avatar":null},"body":"gitster@pobox.com wrote on Sat, 11 Aug 2012 21:41 -0700:\n> Pete Wyckoff <pw@padd.com> writes:\n> \n> > matthew@korich.net wrote on Fri, 10 Aug 2012 12:14 -0700:\n> >> Using git p4 on git version 1.7.12.rc2 has path issues. Standard\n> >> clone/sync ops apparently place detected master and branches on\n> >> independent and parallel directory structures instead of git branches.\n> >> See http://stackoverflow.com/q/11893688/1588831 for a full demo of the problem.\n> >\n> > Thank you for the detailed report.  It is a bug in 1.7.12-rc2.\n> \n> Do you mean \"a feature that was present in 1.7.11 without this bug\n> was broken when used with 1.7.12-rc2\"?  Or do you mean \"this bug\n> exists in 1.7.12-rc2 (older versions may or may not have it, but I\n> am stressing that it is not fixed)\"?\n> \n> The description for [PATCH 5/5] blames v1.7.9-rc0~4^2~1, which tells\n> me it is the latter.  And if that were the case, and if this were in\n> the area of the system I oversee, I wouldn't push it to the upcoming\n> release at this late in the cycle, when I do not know what other\n> things it might break while fixing this bug (in other words, a fix\n> to an old bug is not an execuse to introduce a regression).\n> \n> But git-p4 is not in my area, so if you meant this should go in the\n> upcoming 1.7.12 release, I'll queue them directly on 'master'.\n> \n> Please tell me what your preference is.\n\nGood point about \"already released bugs\".  I confirmed it was\nbroken in 1.7.11 too, so there's no reason to rush this fix into\n1.7.12.  If you could queue it up in pu, that would be great.\nOtherwise I'll resubmit after the upcoming release.\n\nThanks,\n\n\t\t-- Pete\n"},{"id":"196887","messageId":"7vpq6vgb66.fsf@alter.siamese.dyndns.org","threadId":"31229","inReplyTo":"20120812140449.GA5635@padd.com","subject":"Re: [PATCH 0/5] git p4: fix branch detection with --use-client-spec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-12T19:30:57Z","receivedAt":"2012-08-12T19:30:57Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pete Wyckoff <pw@padd.com> writes:\n\n>> The description for [PATCH 5/5] blames v1.7.9-rc0~4^2~1, which tells\n>> me it is the latter.  And if that were the case, and if this were in\n>> the area of the system I oversee, I wouldn't push it to the upcoming\n>> release at this late in the cycle, when I do not know what other\n>> things it might break while fixing this bug (in other words, a fix\n>> to an old bug is not an execuse to introduce a regression).\n>> \n>> But git-p4 is not in my area, so if you meant this should go in the\n>> upcoming 1.7.12 release, I'll queue them directly on 'master'.\n>> \n>> Please tell me what your preference is.\n>\n> Good point about \"already released bugs\".  I confirmed it was\n> broken in 1.7.11 too, so there's no reason to rush this fix into\n> 1.7.12.  If you could queue it up in pu, that would be great.\n\nOK, I've done so already last night when I wrote my message but\nhaven't pushed the result out yet.\n\nNote (primarily to other people) that the above exchange does not\nmean \"a fix to an old bug is automatically disqualified during the\nrc freeze period\".  If the fix is so focused and obvious that there\nis no way the change inadvertently and negatively affects other code\nand introduce a new bug, it is perfectly fine to apply the fix any\ntime.  I don't know git-p4 well enough to tell if this five patch\nseries was in that \"obviously safe\" category myself, so I asked Pete\nto decide it for me.\n\nThanks.\n"}]}