{"thread":{"id":"26694","subject":"Cannot fetch whole history from Perforce","startedAt":"2011-03-08T18:09:55Z","lastAt":"2011-03-12T06:45:40Z","messageCount":4,"participants":["Anatol Pomozov","Thomas Berg","Tor Arvid Lund"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"162997","messageId":"AANLkTik6fxHUJbp6dWdAgV-wr=P=FxK1K-vGAGy8ruBd@mail.gmail.com","threadId":"26694","inReplyTo":null,"subject":"Cannot fetch whole history from Perforce","fromName":"Anatol Pomozov","fromEmail":"anatol.pomozov@gmail.com","sentAt":"2011-03-08T18:09:55Z","receivedAt":"2011-03-08T18:09:55Z","isPatch":false,"sender":{"key":"anatol.pomozov@gmail.com","avatar":"https://gravatar.com/avatar/71fc20093402ce987148294ec0999d025209e52da6762789ff248cf5c317645f?d=mp&s=160"},"body":"Hi, I am using HEAD version of the git and I have an issue with git-p4\ntool (p4 to git importer).\n\ngit-p4 works fine when I import HEAD version of my project\n\n$ git p4 clone //depot/foo/bar --verbose\nImporting from //depot/foo/bar into bar\nReinitialized existing Git repository in /home/anatol/tmp/bar/.git/\nReading pipe: git config git-p4.useclientspec\nDoing initial import of //depot/foo/bar/ from revision #head into\nrefs/remotes/p4/master\nReading pipe: git config git-p4.user\nReading pipe: git config git-p4.password\nReading pipe: git config git-p4.port\nReading pipe: git config git-p4.host\nReading pipe: git config git-p4.client\np4 -G files //depot/foo/bar/...#head\nOpening pipe: p4 -G files //depot/foo/bar/...#head\ncommit into refs/remotes/p4/master\np4 -G users\nOpening pipe: p4 -G users\np4 -G -x - print\nOpening pipe: p4 -G -x - print\n...A bunch of files...\nexecuting git branch master refs/remotes/p4/master\nexecuting git checkout -f\n\n\nBut it fails with a cryptic error when I try to import @all revisions:\n\n$ git p4 clone //depot/foo/bar@all --verbose\nImporting from //depot/foo/bar@all into bar\nInitialized empty Git repository in /home/anatol/tmp/bar/.git/\nReading pipe: git config git-p4.useclientspec\nTraceback (most recent call last):\n  File \"/home/anatol/bin/git-p4\", line 2033, in <module>\n    main()\n  File \"/home/anatol/bin/git-p4\", line 2028, in main\n    if not cmd.run(args):\n  File \"/home/anatol/bin/git-p4\", line 1904, in run\n    if not P4Sync.run(self, depotPaths):\n  File \"/home/anatol/bin/git-p4\", line 1767, in run\n    die(\"No remote p4 branches.  Perhaps you never did \\\"git p4\nclone\\\" in here.\");\n  File \"/home/anatol/bin/git-p4\", line 59, in die\n    raise Exception(msg)\nException: No remote p4 branches.  Perhaps you never did \"git p4 clone\" in here.\n\nCan it be related to Pete's changes?\nhttp://permalink.gmane.org/gmane.comp.version-control.git/167281\n"},{"id":"163013","messageId":"AANLkTin6BBD+b2OYRk32GyAaEqFa-V7T1B7jEVujRkuL@mail.gmail.com","threadId":"26694","inReplyTo":"AANLkTik6fxHUJbp6dWdAgV-wr=P=FxK1K-vGAGy8ruBd@mail.gmail.com","subject":"Re: Cannot fetch whole history from Perforce","fromName":"Thomas Berg","fromEmail":"merlin66b@gmail.com","sentAt":"2011-03-08T20:36:31Z","receivedAt":"2011-03-08T20:36:31Z","isPatch":false,"sender":{"key":"merlin66b@gmail.com","avatar":null},"body":"Hi,\n\nOn Tue, Mar 8, 2011 at 7:09 PM, Anatol Pomozov <anatol.pomozov@gmail.com> wrote:\n> Hi, I am using HEAD version of the git and I have an issue with git-p4\n> tool (p4 to git importer).\n>\n> git-p4 works fine when I import HEAD version of my project\n>\n> $ git p4 clone //depot/foo/bar --verbose\n> But it fails with a cryptic error when I try to import @all revisions:\n[...]\n>\n> $ git p4 clone //depot/foo/bar@all --verbose\n> Importing from //depot/foo/bar@all into bar\n[...]\n>\n> Can it be related to Pete's changes?\n> http://permalink.gmane.org/gmane.comp.version-control.git/167281\n\nSorry for not testing myself before responding, but in my experience\nwith Perforce a trailing slash may be significant. Did you try this\nformat?\n$ git p4 clone //depot/foo/bar/@all\nIf that also fails you may be onto something.\n\n- Thomas\n"},{"id":"163037","messageId":"AANLkTimaB3BU3YQgC7qgqUH=qYGrthPxnz63b-MLAbCR@mail.gmail.com","threadId":"26694","inReplyTo":"AANLkTin6BBD+b2OYRk32GyAaEqFa-V7T1B7jEVujRkuL@mail.gmail.com","subject":"Re: Cannot fetch whole history from Perforce","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2011-03-08T22:33:21Z","receivedAt":"2011-03-08T22:33:21Z","isPatch":false,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"On Tue, Mar 8, 2011 at 9:36 PM, Thomas Berg <merlin66b@gmail.com> wrote:\n> Hi,\n>\n> On Tue, Mar 8, 2011 at 7:09 PM, Anatol Pomozov <anatol.pomozov@gmail.com> wrote:\n>> Hi, I am using HEAD version of the git and I have an issue with git-p4\n>> tool (p4 to git importer).\n>>\n>> git-p4 works fine when I import HEAD version of my project\n>>\n>> $ git p4 clone //depot/foo/bar --verbose\n>> But it fails with a cryptic error when I try to import @all revisions:\n> [...]\n>>\n>> $ git p4 clone //depot/foo/bar@all --verbose\n>> Importing from //depot/foo/bar@all into bar\n> [...]\n>>\n>> Can it be related to Pete's changes?\n>> http://permalink.gmane.org/gmane.comp.version-control.git/167281\n\nWhoops! The P4Clone class is a subclass of P4Sync, which means that\nthis check (The one you mention from e32e00dc) will be done on every\nclone with @all. We can't have that :)\n\nIt works for me if I patch it with this one-liner (but it's not\nexactly a beautiful looking line of code anymore):\n\n    -- Tor Arvid\n---\n\ndiff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\nindex 2df3bb2..7cb479c 100755\n--- a/contrib/fast-import/git-p4\n+++ b/contrib/fast-import/git-p4\n@@ -1763,7 +1763,7 @@ class P4Sync(Command):\n\n                 changes.sort()\n             else:\n-                if not self.p4BranchesInGit:\n+                if not isinstance(self, P4Clone) and not self.p4BranchesInGit:\n                     die(\"No remote p4 branches.  Perhaps you never\ndid \\\"git p4 clone\\\" in here.\");\n                 if self.verbose:\n                     print \"Getting p4 changes for %s...%s\" % (',\n'.join(self.depotPaths),\n"},{"id":"163256","messageId":"AANLkTiktQqzxFLn7R+EKm-WxWp95xZoGqKu7ijtRHASe@mail.gmail.com","threadId":"26694","inReplyTo":"AANLkTimaB3BU3YQgC7qgqUH=qYGrthPxnz63b-MLAbCR@mail.gmail.com","subject":"Re: Cannot fetch whole history from Perforce","fromName":"Anatol Pomozov","fromEmail":"anatol.pomozov@gmail.com","sentAt":"2011-03-12T06:45:40Z","receivedAt":"2011-03-12T06:45:40Z","isPatch":false,"sender":{"key":"anatol.pomozov@gmail.com","avatar":"https://gravatar.com/avatar/71fc20093402ce987148294ec0999d025209e52da6762789ff248cf5c317645f?d=mp&s=160"},"body":"Sorry for the slow response.\n\nOn Tue, Mar 8, 2011 at 2:33 PM, Tor Arvid Lund <torarvid@gmail.com> wrote:\n> On Tue, Mar 8, 2011 at 9:36 PM, Thomas Berg <merlin66b@gmail.com> wrote:\n>> Hi,\n>>\n>> On Tue, Mar 8, 2011 at 7:09 PM, Anatol Pomozov <anatol.pomozov@gmail.com> wrote:\n>>> Hi, I am using HEAD version of the git and I have an issue with git-p4\n>>> tool (p4 to git importer).\n>>>\n>>> git-p4 works fine when I import HEAD version of my project\n>>>\n>>> $ git p4 clone //depot/foo/bar --verbose\n>>> But it fails with a cryptic error when I try to import @all revisions:\n>> [...]\n>>>\n>>> $ git p4 clone //depot/foo/bar@all --verbose\n>>> Importing from //depot/foo/bar@all into bar\n>> [...]\n>>>\n>>> Can it be related to Pete's changes?\n>>> http://permalink.gmane.org/gmane.comp.version-control.git/167281\n>\n> Whoops! The P4Clone class is a subclass of P4Sync, which means that\n> this check (The one you mention from e32e00dc) will be done on every\n> clone with @all. We can't have that :)\n>\n> It works for me if I patch it with this one-liner (but it's not\n> exactly a beautiful looking line of code anymore):\n>\n>    -- Tor Arvid\n> ---\n>\n> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4\n> index 2df3bb2..7cb479c 100755\n> --- a/contrib/fast-import/git-p4\n> +++ b/contrib/fast-import/git-p4\n> @@ -1763,7 +1763,7 @@ class P4Sync(Command):\n>\n>                 changes.sort()\n>             else:\n> -                if not self.p4BranchesInGit:\n> +                if not isinstance(self, P4Clone) and not self.p4BranchesInGit:\n>                     die(\"No remote p4 branches.  Perhaps you never\n> did \\\"git p4 clone\\\" in here.\");\n>                 if self.verbose:\n>                     print \"Getting p4 changes for %s...%s\" % (',\n> '.join(self.depotPaths),\n\nYep it fixes the problem for me. Do you have a plan to propose it for upstream?\n"}]}