{"thread":{"id":"39120","subject":"git-p4 Question","startedAt":"2015-04-20T16:41:02Z","lastAt":"2015-04-26T22:27:15Z","messageCount":10,"participants":["FusionX86","Sam Vilain","Luke Diamand"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"259683","messageId":"CAFcBi89YqRGqigR1VCJJQtu1D206rP2T8Y-10KvFnvDjXYaN_g@mail.gmail.com","threadId":"39120","inReplyTo":null,"subject":"git-p4 Question","fromName":"FusionX86","fromEmail":"fusionx86@gmail.com","sentAt":"2015-04-20T16:41:02Z","receivedAt":"2015-04-20T16:41:02Z","isPatch":false,"sender":{"key":"fusionx86@gmail.com","avatar":"https://gravatar.com/avatar/90e4d2885c409dfd8c17dae58e16366269ade40c530c37c0835c0a4942a32698?d=mp&s=160"},"body":"Hello,\n\nHopefully this is an appropriate place to ask questions about git-p4.\n\nI started at a company that wants to migrate from Perforce to Git. I'm\nnew to Perforce and have been trying to learn just enough about it to\nget through this migration. Anyway, I've been playing with git-p4 and\nhave one question/problem to discuss.\n\nAfter setting up the p4 cli client I can 'p4 sync' some\n//depot/main/app1 which pulls down the files I would expect from the\nPerforce server. If I use 'git p4 clone //depot/main/app1', I get:\n\n\"Doing initial import of //depot/main/app1/ from revision #head into\nrefs/remotes/p4/master\"\n\nBut I don't get any files from that depot/folder pulled down. I can\ngit p4 clone other depot/folders though and get some files. I suspect\nthat I'm just not understanding how the git-p4 module works.\n\nBasically, I'm hoping to setup a live sync of Perforce to Git of\ncertain depots in preparation for the migration. Also, if anyone has\npointers or guides for this type of migration, any help is\nappreciated.\n"},{"id":"259689","messageId":"5535443C.1060600@vilain.net","threadId":"39120","inReplyTo":"CAFcBi89YqRGqigR1VCJJQtu1D206rP2T8Y-10KvFnvDjXYaN_g@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2015-04-20T18:23:56Z","receivedAt":"2015-04-20T18:23:56Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"On 04/20/2015 09:41 AM, FusionX86 wrote:\n> Hopefully this is an appropriate place to ask questions about git-p4.\n>\n> I started at a company that wants to migrate from Perforce to Git. I'm\n> new to Perforce and have been trying to learn just enough about it to\n> get through this migration.\n\nYou might also like to check out my git-p4raw project which imports \ndirectly from the raw repository files into a git repo using git fast-import\n\n     http://github.com/samv/git-p4raw\n\nApparently it's my most popular github project :-).  YMMV.\n\nSam.\n"},{"id":"259698","messageId":"553552FD.80703@diamand.org","threadId":"39120","inReplyTo":"CAFcBi89YqRGqigR1VCJJQtu1D206rP2T8Y-10KvFnvDjXYaN_g@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-20T19:26:53Z","receivedAt":"2015-04-20T19:26:53Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 20/04/15 17:41, FusionX86 wrote:\n> Hello,\n>\n> Hopefully this is an appropriate place to ask questions about git-p4.\n>\n> I started at a company that wants to migrate from Perforce to Git. I'm\n> new to Perforce and have been trying to learn just enough about it to\n> get through this migration. Anyway, I've been playing with git-p4 and\n> have one question/problem to discuss.\n>\n> After setting up the p4 cli client I can 'p4 sync' some\n> //depot/main/app1 which pulls down the files I would expect from the\n> Perforce server. If I use 'git p4 clone //depot/main/app1', I get:\n>\n> \"Doing initial import of //depot/main/app1/ from revision #head into\n> refs/remotes/p4/master\"\n>\n> But I don't get any files from that depot/folder pulled down. I can\n> git p4 clone other depot/folders though and get some files. I suspect\n> that I'm just not understanding how the git-p4 module works.\n\nYou could try doing the clone with '-v' to get a bit more information.\n\n>\n> Basically, I'm hoping to setup a live sync of Perforce to Git of\n> certain depots in preparation for the migration. Also, if anyone has\n> pointers or guides for this type of migration, any help is\n> appreciated.\n\nI've done something similar in the past. You'll want to enable the \n--preserve-user option, for which you will need admin rights.\n\nIf it's a one-way mirror (p4-to-git) then just run git-p4 periodically \n(if you use cron, then try to avoid having two or more instances running \nat the same time).\n\nIf you want it to be two-way then it gets a bit more complicated.\n\nYou might also want to consider using git fusion, which is Perforce's \ntake on this problem. I've not used it myself.\n\n From past experience though I would say the biggest problem is getting \ndevelopers to switch from the P4 mindset (centralized; code review hard \nto do or ignored) to the git mindset (decentralized; code review \nactively supported by the version control system).\n\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"259734","messageId":"CAFcBi88CwmJ=bxf92BWKLB2m25jnJFD6jpFPYog9Hdneen38DQ@mail.gmail.com","threadId":"39120","inReplyTo":"5535443C.1060600@vilain.net","subject":"Re: git-p4 Question","fromName":"FusionX86","fromEmail":"fusionx86@gmail.com","sentAt":"2015-04-21T13:23:51Z","receivedAt":"2015-04-21T13:23:51Z","isPatch":false,"sender":{"key":"fusionx86@gmail.com","avatar":"https://gravatar.com/avatar/90e4d2885c409dfd8c17dae58e16366269ade40c530c37c0835c0a4942a32698?d=mp&s=160"},"body":"Thanks Sam, I'll check it out.\n\nOn Mon, Apr 20, 2015 at 12:23 PM, Sam Vilain <sam@vilain.net> wrote:\n> On 04/20/2015 09:41 AM, FusionX86 wrote:\n>>\n>> Hopefully this is an appropriate place to ask questions about git-p4.\n>>\n>> I started at a company that wants to migrate from Perforce to Git. I'm\n>> new to Perforce and have been trying to learn just enough about it to\n>> get through this migration.\n>\n>\n> You might also like to check out my git-p4raw project which imports directly\n> from the raw repository files into a git repo using git fast-import\n>\n>     http://github.com/samv/git-p4raw\n>\n> Apparently it's my most popular github project :-).  YMMV.\n>\n> Sam.\n"},{"id":"259735","messageId":"CAFcBi89pXTKzeVkB5EN3ZYkLwa1oPfDOqdHHhHeVogswhnpOAg@mail.gmail.com","threadId":"39120","inReplyTo":"553552FD.80703@diamand.org","subject":"Re: git-p4 Question","fromName":"FusionX86","fromEmail":"fusionx86@gmail.com","sentAt":"2015-04-21T13:33:34Z","receivedAt":"2015-04-21T13:33:34Z","isPatch":false,"sender":{"key":"fusionx86@gmail.com","avatar":"https://gravatar.com/avatar/90e4d2885c409dfd8c17dae58e16366269ade40c530c37c0835c0a4942a32698?d=mp&s=160"},"body":"Hi Luke,\n\nUsing -v was a good suggestion. Unfortunately I still don't see what\nthe problem is. I'm starting to think that maybe I should just create\nthe client views I need and setup a cron job that p4 syncs and then\ngit commits/pushes.\n\nThe --preserve-user option is for submitting back to Perforce correct?\nI'm hoping to get away with a one-way sync from Perforce to Git...and\nthen eventually just cut over to Git.\n\nI also looked at git fusion, but unfortunately the version of Perforce\nwe're running (2012.1) doesn't meet the requirements for fusion. I\nwish it did.\n\nGood point on developer mindset. I think we definitely have some\ntraining and habit changing in the future.\n\nThanks for the suggestions and pointers, it's much appreciated.\n\nOn Mon, Apr 20, 2015 at 1:26 PM, Luke Diamand <luke@diamand.org> wrote:\n> On 20/04/15 17:41, FusionX86 wrote:\n>>\n>> Hello,\n>>\n>> Hopefully this is an appropriate place to ask questions about git-p4.\n>>\n>> I started at a company that wants to migrate from Perforce to Git. I'm\n>> new to Perforce and have been trying to learn just enough about it to\n>> get through this migration. Anyway, I've been playing with git-p4 and\n>> have one question/problem to discuss.\n>>\n>> After setting up the p4 cli client I can 'p4 sync' some\n>> //depot/main/app1 which pulls down the files I would expect from the\n>> Perforce server. If I use 'git p4 clone //depot/main/app1', I get:\n>>\n>> \"Doing initial import of //depot/main/app1/ from revision #head into\n>> refs/remotes/p4/master\"\n>>\n>> But I don't get any files from that depot/folder pulled down. I can\n>> git p4 clone other depot/folders though and get some files. I suspect\n>> that I'm just not understanding how the git-p4 module works.\n>\n>\n> You could try doing the clone with '-v' to get a bit more information.\n>\n>>\n>> Basically, I'm hoping to setup a live sync of Perforce to Git of\n>> certain depots in preparation for the migration. Also, if anyone has\n>> pointers or guides for this type of migration, any help is\n>> appreciated.\n>\n>\n> I've done something similar in the past. You'll want to enable the\n> --preserve-user option, for which you will need admin rights.\n>\n> If it's a one-way mirror (p4-to-git) then just run git-p4 periodically (if\n> you use cron, then try to avoid having two or more instances running at the\n> same time).\n>\n> If you want it to be two-way then it gets a bit more complicated.\n>\n> You might also want to consider using git fusion, which is Perforce's take\n> on this problem. I've not used it myself.\n>\n> From past experience though I would say the biggest problem is getting\n> developers to switch from the P4 mindset (centralized; code review hard to\n> do or ignored) to the git mindset (decentralized; code review actively\n> supported by the version control system).\n>\n>> --\n>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>> the body of a message to majordomo@vger.kernel.org\n>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>\n>\n"},{"id":"259738","messageId":"CAE5ih79L+RU934OYsBrXjP7PAoDYbeBS01hCgsOm+pnFD+dWwQ@mail.gmail.com","threadId":"39120","inReplyTo":"CAFcBi89pXTKzeVkB5EN3ZYkLwa1oPfDOqdHHhHeVogswhnpOAg@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-21T16:53:37Z","receivedAt":"2015-04-21T16:53:37Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"Can you post up the output from 'git p4 clone', and also see what the\noutput from doing this is:\n\n$ p4 print //depot/some/branch/missingfile.c\n\n\n\nOn 21 April 2015 at 14:33, FusionX86 <fusionx86@gmail.com> wrote:\n> Hi Luke,\n>\n> Using -v was a good suggestion. Unfortunately I still don't see what\n> the problem is. I'm starting to think that maybe I should just create\n> the client views I need and setup a cron job that p4 syncs and then\n> git commits/pushes.\n>\n> The --preserve-user option is for submitting back to Perforce correct?\n> I'm hoping to get away with a one-way sync from Perforce to Git...and\n> then eventually just cut over to Git.\n>\n> I also looked at git fusion, but unfortunately the version of Perforce\n> we're running (2012.1) doesn't meet the requirements for fusion. I\n> wish it did.\n>\n> Good point on developer mindset. I think we definitely have some\n> training and habit changing in the future.\n>\n> Thanks for the suggestions and pointers, it's much appreciated.\n>\n> On Mon, Apr 20, 2015 at 1:26 PM, Luke Diamand <luke@diamand.org> wrote:\n>> On 20/04/15 17:41, FusionX86 wrote:\n>>>\n>>> Hello,\n>>>\n>>> Hopefully this is an appropriate place to ask questions about git-p4.\n>>>\n>>> I started at a company that wants to migrate from Perforce to Git. I'm\n>>> new to Perforce and have been trying to learn just enough about it to\n>>> get through this migration. Anyway, I've been playing with git-p4 and\n>>> have one question/problem to discuss.\n>>>\n>>> After setting up the p4 cli client I can 'p4 sync' some\n>>> //depot/main/app1 which pulls down the files I would expect from the\n>>> Perforce server. If I use 'git p4 clone //depot/main/app1', I get:\n>>>\n>>> \"Doing initial import of //depot/main/app1/ from revision #head into\n>>> refs/remotes/p4/master\"\n>>>\n>>> But I don't get any files from that depot/folder pulled down. I can\n>>> git p4 clone other depot/folders though and get some files. I suspect\n>>> that I'm just not understanding how the git-p4 module works.\n>>\n>>\n>> You could try doing the clone with '-v' to get a bit more information.\n>>\n>>>\n>>> Basically, I'm hoping to setup a live sync of Perforce to Git of\n>>> certain depots in preparation for the migration. Also, if anyone has\n>>> pointers or guides for this type of migration, any help is\n>>> appreciated.\n>>\n>>\n>> I've done something similar in the past. You'll want to enable the\n>> --preserve-user option, for which you will need admin rights.\n>>\n>> If it's a one-way mirror (p4-to-git) then just run git-p4 periodically (if\n>> you use cron, then try to avoid having two or more instances running at the\n>> same time).\n>>\n>> If you want it to be two-way then it gets a bit more complicated.\n>>\n>> You might also want to consider using git fusion, which is Perforce's take\n>> on this problem. I've not used it myself.\n>>\n>> From past experience though I would say the biggest problem is getting\n>> developers to switch from the P4 mindset (centralized; code review hard to\n>> do or ignored) to the git mindset (decentralized; code review actively\n>> supported by the version control system).\n>>\n>>> --\n>>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>>> the body of a message to majordomo@vger.kernel.org\n>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>>\n>>\n"},{"id":"259898","messageId":"CAFcBi88ZohscEZXVXbaf+6=ZKJAy9LRfn2-4WT0JV+1RodBTJg@mail.gmail.com","threadId":"39120","inReplyTo":"CAE5ih79L+RU934OYsBrXjP7PAoDYbeBS01hCgsOm+pnFD+dWwQ@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"FusionX86","fromEmail":"fusionx86@gmail.com","sentAt":"2015-04-23T13:42:14Z","receivedAt":"2015-04-23T13:42:14Z","isPatch":false,"sender":{"key":"fusionx86@gmail.com","avatar":"https://gravatar.com/avatar/90e4d2885c409dfd8c17dae58e16366269ade40c530c37c0835c0a4942a32698?d=mp&s=160"},"body":"Hi Luke,\n\nI found a silly mistake I was making in the command I've been using.\nThe folder under the depot should have been capitalized, but it\nwasn't. Also, I expected that if there was a problem with the command,\nit would fail with some message instead of creating an empty local git\nrepo.\n\nNow I'll move forward with setting up an automated and periodic sync\nof P4 to Git in preparation for the migration. Thanks Luke, your\nsuggestions prompted me to look in the right location for the problem.\n\n\nOn Tue, Apr 21, 2015 at 10:53 AM, Luke Diamand <luke@diamand.org> wrote:\n> Can you post up the output from 'git p4 clone', and also see what the\n> output from doing this is:\n>\n> $ p4 print //depot/some/branch/missingfile.c\n>\n>\n>\n> On 21 April 2015 at 14:33, FusionX86 <fusionx86@gmail.com> wrote:\n>> Hi Luke,\n>>\n>> Using -v was a good suggestion. Unfortunately I still don't see what\n>> the problem is. I'm starting to think that maybe I should just create\n>> the client views I need and setup a cron job that p4 syncs and then\n>> git commits/pushes.\n>>\n>> The --preserve-user option is for submitting back to Perforce correct?\n>> I'm hoping to get away with a one-way sync from Perforce to Git...and\n>> then eventually just cut over to Git.\n>>\n>> I also looked at git fusion, but unfortunately the version of Perforce\n>> we're running (2012.1) doesn't meet the requirements for fusion. I\n>> wish it did.\n>>\n>> Good point on developer mindset. I think we definitely have some\n>> training and habit changing in the future.\n>>\n>> Thanks for the suggestions and pointers, it's much appreciated.\n>>\n>> On Mon, Apr 20, 2015 at 1:26 PM, Luke Diamand <luke@diamand.org> wrote:\n>>> On 20/04/15 17:41, FusionX86 wrote:\n>>>>\n>>>> Hello,\n>>>>\n>>>> Hopefully this is an appropriate place to ask questions about git-p4.\n>>>>\n>>>> I started at a company that wants to migrate from Perforce to Git. I'm\n>>>> new to Perforce and have been trying to learn just enough about it to\n>>>> get through this migration. Anyway, I've been playing with git-p4 and\n>>>> have one question/problem to discuss.\n>>>>\n>>>> After setting up the p4 cli client I can 'p4 sync' some\n>>>> //depot/main/app1 which pulls down the files I would expect from the\n>>>> Perforce server. If I use 'git p4 clone //depot/main/app1', I get:\n>>>>\n>>>> \"Doing initial import of //depot/main/app1/ from revision #head into\n>>>> refs/remotes/p4/master\"\n>>>>\n>>>> But I don't get any files from that depot/folder pulled down. I can\n>>>> git p4 clone other depot/folders though and get some files. I suspect\n>>>> that I'm just not understanding how the git-p4 module works.\n>>>\n>>>\n>>> You could try doing the clone with '-v' to get a bit more information.\n>>>\n>>>>\n>>>> Basically, I'm hoping to setup a live sync of Perforce to Git of\n>>>> certain depots in preparation for the migration. Also, if anyone has\n>>>> pointers or guides for this type of migration, any help is\n>>>> appreciated.\n>>>\n>>>\n>>> I've done something similar in the past. You'll want to enable the\n>>> --preserve-user option, for which you will need admin rights.\n>>>\n>>> If it's a one-way mirror (p4-to-git) then just run git-p4 periodically (if\n>>> you use cron, then try to avoid having two or more instances running at the\n>>> same time).\n>>>\n>>> If you want it to be two-way then it gets a bit more complicated.\n>>>\n>>> You might also want to consider using git fusion, which is Perforce's take\n>>> on this problem. I've not used it myself.\n>>>\n>>> From past experience though I would say the biggest problem is getting\n>>> developers to switch from the P4 mindset (centralized; code review hard to\n>>> do or ignored) to the git mindset (decentralized; code review actively\n>>> supported by the version control system).\n>>>\n>>>> --\n>>>> To unsubscribe from this list: send the line \"unsubscribe git\" in\n>>>> the body of a message to majordomo@vger.kernel.org\n>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>>>>\n>>>\n"},{"id":"259933","messageId":"553A0ACF.4000006@diamand.org","threadId":"39120","inReplyTo":"CAFcBi88ZohscEZXVXbaf+6=ZKJAy9LRfn2-4WT0JV+1RodBTJg@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-24T09:20:15Z","receivedAt":"2015-04-24T09:20:15Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 23/04/15 14:42, FusionX86 wrote:\n> Hi Luke,\n>\n> I found a silly mistake I was making in the command I've been using.\n> The folder under the depot should have been capitalized, but it\n> wasn't. Also, I expected that if there was a problem with the command,\n> it would fail with some message instead of creating an empty local git\n> repo.\n\nI would expect that as well - it will usually create the empty git repo, \nbut it should then fail with an error message, like this:\n\n$ git p4 clone //depot/main/nosuchpath\nImporting from //depot/main/nosuchpath into nosuchpath\nInitialized empty Git repository in \n/home/lgd/p4-hacking/git/nosuchpath/.git/\nDoing initial import of //depot/main/nosuchpath/ from revision #head \ninto refs/remotes/p4/master\np4 returned an error: //depot/main/nosuchpath/...#head - no such file(s).\n\n$ echo $?\n1\n\nIf you get a moment can you send your command output; if it's not doing \nsomething like the above, then it's a bug.\n\nThanks!\n\nLuke\n"},{"id":"259947","messageId":"CAFcBi8-GGxrtm+f7NEf0PmWTkS0m6x2fNPt+y4bopqNLfyvyoQ@mail.gmail.com","threadId":"39120","inReplyTo":"553A0ACF.4000006@diamand.org","subject":"Re: git-p4 Question","fromName":"FusionX86","fromEmail":"fusionx86@gmail.com","sentAt":"2015-04-24T14:36:57Z","receivedAt":"2015-04-24T14:36:57Z","isPatch":false,"sender":{"key":"fusionx86@gmail.com","avatar":"https://gravatar.com/avatar/90e4d2885c409dfd8c17dae58e16366269ade40c530c37c0835c0a4942a32698?d=mp&s=160"},"body":"I get an error if I misspell part of the path. For example, if I type\n//depot/maain instead of //depot/main I will get the \"no such files\"\nmessage you indicated. BUT using incorrect case like //depot/main\ninstead of //depot/Main doesn't return any error, but still completes\nand creates an empty repo. If it does require correct case, then it\nshould throw an error for //depot/main as well.\n\nLet me know if you need any additional information.\n\nOn Fri, Apr 24, 2015 at 3:20 AM, Luke Diamand <luke@diamand.org> wrote:\n> On 23/04/15 14:42, FusionX86 wrote:\n>>\n>> Hi Luke,\n>>\n>> I found a silly mistake I was making in the command I've been using.\n>> The folder under the depot should have been capitalized, but it\n>> wasn't. Also, I expected that if there was a problem with the command,\n>> it would fail with some message instead of creating an empty local git\n>> repo.\n>\n>\n> I would expect that as well - it will usually create the empty git repo, but\n> it should then fail with an error message, like this:\n>\n> $ git p4 clone //depot/main/nosuchpath\n> Importing from //depot/main/nosuchpath into nosuchpath\n> Initialized empty Git repository in\n> /home/lgd/p4-hacking/git/nosuchpath/.git/\n> Doing initial import of //depot/main/nosuchpath/ from revision #head into\n> refs/remotes/p4/master\n> p4 returned an error: //depot/main/nosuchpath/...#head - no such file(s).\n>\n> $ echo $?\n> 1\n>\n> If you get a moment can you send your command output; if it's not doing\n> something like the above, then it's a bug.\n>\n> Thanks!\n>\n> Luke\n>\n"},{"id":"260045","messageId":"553D6643.5020100@diamand.org","threadId":"39120","inReplyTo":"CAFcBi8-GGxrtm+f7NEf0PmWTkS0m6x2fNPt+y4bopqNLfyvyoQ@mail.gmail.com","subject":"Re: git-p4 Question","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2015-04-26T22:27:15Z","receivedAt":"2015-04-26T22:27:15Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On 24/04/15 15:36, FusionX86 wrote:\n> I get an error if I misspell part of the path. For example, if I type\n> //depot/maain instead of //depot/main I will get the \"no such files\"\n> message you indicated. BUT using incorrect case like //depot/main\n> instead of //depot/Main doesn't return any error, but still completes\n> and creates an empty repo. If it does require correct case, then it\n> should throw an error for //depot/main as well.\n\nThanks, that's a somewhat subtle bug....!\n\nLuke\n"}]}