{"thread":{"id":"12253","subject":"[GIT-P4] usage under Windows","startedAt":"2008-02-22T06:44:41Z","lastAt":"2008-03-03T19:24:28Z","messageCount":9,"participants":["Maxim Gordienko","Marius Storm-Olsen","Tor Arvid Lund"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"69551","messageId":"96c268400802212244g7fd2de2bj6c1b7022885c8e89@mail.gmail.com","threadId":"12253","inReplyTo":null,"subject":"[GIT-P4] usage under Windows","fromName":"Maxim Gordienko","fromEmail":"mgordienko@gmail.com","sentAt":"2008-02-22T06:44:41Z","receivedAt":"2008-02-22T06:44:41Z","isPatch":false,"sender":{"key":"mgordienko@gmail.com","avatar":null},"body":"Hello!\n\nWhat are best practices to use git-p4 under windows?\nWhat p4 client should i use, native or cygwin one? Is any special\nperforce client configuration required?\nWhat python distribution is preferred, included in cygwin or active python?\nWhere i need to put imported directory under perforce client' root or\nin any other place?\n\nThank you!\n"},{"id":"70168","messageId":"47C5E4EC.1060003@trolltech.com","threadId":"12253","inReplyTo":"96c268400802212244g7fd2de2bj6c1b7022885c8e89@mail.gmail.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-02-27T22:32:12Z","receivedAt":"2008-02-27T22:32:12Z","isPatch":false,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Maxim Gordienko wrote:\n> What are best practices to use git-p4 under windows?\n> What p4 client should i use, native or cygwin one? Is any special\n> perforce client configuration required?\n > What python distribution is preferred, included in cygwin or active \npython?\n\nDepends on what your system is. Are you using Git under Cygwin or MSys? \nIf you're using Cygwin normally, it's probably wise to use the cygwin \nversion of perforce too.\n\nHere's what I do:\n     1) Use MSys Git. It's faster. (http://code.google.com/p/msysgit/)\n     2) Use native Perforce. It's faster.\n     3) Get Python from python.org. There's a binary installer.\n\n> Where i need to put imported directory under perforce client' root or\n> in any other place?\n\nIn perforce create your client spec somewhere where you don't see it. \nYou never need to touch these files, but they are needed to be able to \nsubmit back to the perforce depot, if you need that. For cloning a \nperforce depot, you don't need a checkout (git-p4 used 'p4 print' to get \nthe files directly)\n\nKeep in mind to always rebase your patches before submitting back to a \nPerforce depot, since merges can be represented properly. So, a good \nwork practice is to\n    1) Clone perforce branch\n    2) work, work, commit, work, commit...\n    3) git p4 rebase\n    4) git p4 submit\n\nGood luck!\n\n--\n.marius\n\n"},{"id":"70406","messageId":"96c268400802291048u31a2d8b6ub1726ade941afb8c@mail.gmail.com","threadId":"12253","inReplyTo":"47C5E4EC.1060003@trolltech.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Maxim Gordienko","fromEmail":"mgordienko@gmail.com","sentAt":"2008-02-29T18:48:58Z","receivedAt":"2008-02-29T18:48:58Z","isPatch":false,"sender":{"key":"mgordienko@gmail.com","avatar":null},"body":"Thank you, Marius for detailed instructions!\nNow everything except submitting back to perforce works like a charm.\nPerforce complains about git-p4 checkout is not under it's root\n\nSynchronizing p4 checkout...\nexecuting p4 sync ...\nPath 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n\nif I move checkout under perforce root git-p4 unable to create patch.\nHave you encounter such errors?\nThank you!\n\nOn Thu, Feb 28, 2008 at 1:32 AM, Marius Storm-Olsen\n<marius@trolltech.com> wrote:\n> Maxim Gordienko wrote:\n> > What are best practices to use git-p4 under windows?\n> > What p4 client should i use, native or cygwin one? Is any special\n> > perforce client configuration required?\n>  > What python distribution is preferred, included in cygwin or active\n> python?\n>\n> Depends on what your system is. Are you using Git under Cygwin or MSys?\n> If you're using Cygwin normally, it's probably wise to use the cygwin\n> version of perforce too.\n>\n> Here's what I do:\n>     1) Use MSys Git. It's faster. (http://code.google.com/p/msysgit/)\n>     2) Use native Perforce. It's faster.\n>     3) Get Python from python.org. There's a binary installer.\n>\n> > Where i need to put imported directory under perforce client' root or\n> > in any other place?\n>\n> In perforce create your client spec somewhere where you don't see it.\n> You never need to touch these files, but they are needed to be able to\n> submit back to the perforce depot, if you need that. For cloning a\n> perforce depot, you don't need a checkout (git-p4 used 'p4 print' to get\n> the files directly)\n>\n> Keep in mind to always rebase your patches before submitting back to a\n> Perforce depot, since merges can be represented properly. So, a good\n> work practice is to\n>    1) Clone perforce branch\n>    2) work, work, commit, work, commit...\n>    3) git p4 rebase\n>    4) git p4 submit\n>\n> Good luck!\n>\n> --\n> .marius\n>\n>\n"},{"id":"70429","messageId":"47C87F1C.10309@trolltech.com","threadId":"12253","inReplyTo":"96c268400802291048u31a2d8b6ub1726ade941afb8c@mail.gmail.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-02-29T21:54:36Z","receivedAt":"2008-02-29T21:54:36Z","isPatch":false,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Maxim Gordienko wrote:\n> Thank you, Marius for detailed instructions!\n> Now everything except submitting back to perforce works like a charm.\n> Perforce complains about git-p4 checkout is not under it's root\n> \n> Synchronizing p4 checkout...\n> executing p4 sync ...\n> Path 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n> \n> if I move checkout under perforce root git-p4 unable to create patch.\n> Have you encounter such errors?\n\nNot that I recall..\nHowever, it seems like you are using an older version of git-p4, so try \njust grabbing the latest one \n(http://repo.or.cz/w/git.git?a=blob_plain;f=contrib/fast-import/git-p4;hb=maint) \nand see if that helps you. If it doesn't work maybe you can tell me what \nyour p4 client spec looks like?\n\n--\n.marius\n\n\n"},{"id":"70491","messageId":"96c268400802292341y5ac5f287yc5af7afe9aff983a@mail.gmail.com","threadId":"12253","inReplyTo":"47C87F1C.10309@trolltech.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Maxim Gordienko","fromEmail":"mgordienko@gmail.com","sentAt":"2008-03-01T07:41:29Z","receivedAt":"2008-03-01T07:41:29Z","isPatch":false,"sender":{"key":"mgordienko@gmail.com","avatar":null},"body":"No, unfortunately lattest git-p4 does not help. p4 still complain\nabout location of checkout or unable to apply patch(\"file(s) not on\nclient\").\nMy client spec is (p4 itselt is 2007.3)\n---\nClient:\tYOUR-6C9B4BEFA3\n\nUpdate:\t2008/02/22 01:03:06\n\nAccess:\t2008/03/01 10:32:50\n\nOwner:\tfoo\n\nDescription:\n\tCreated by foo.\n\nRoot:\tc:\\p4\n\nOptions:\tnoallwrite noclobber nocompress unlocked nomodtime normdir\n\nSubmitOptions:\tsubmitunchanged\n\nLineEnd:\tlocal\n\nView:\n\t//depot/... //YOUR-6C9B4BEFA3/...\n---\nThank you!\n\nOn Sat, Mar 1, 2008 at 12:54 AM, Marius Storm-Olsen\n<marius@trolltech.com> wrote:\n> Maxim Gordienko wrote:\n> > Thank you, Marius for detailed instructions!\n> > Now everything except submitting back to perforce works like a charm.\n> > Perforce complains about git-p4 checkout is not under it's root\n> >\n> > Synchronizing p4 checkout...\n> > executing p4 sync ...\n> > Path 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n> >\n> > if I move checkout under perforce root git-p4 unable to create patch.\n> > Have you encounter such errors?\n>\n> Not that I recall..\n> However, it seems like you are using an older version of git-p4, so try\n> just grabbing the latest one\n> (http://repo.or.cz/w/git.git?a=blob_plain;f=contrib/fast-import/git-p4;hb=maint)\n> and see if that helps you. If it doesn't work maybe you can tell me what\n> your p4 client spec looks like?\n>\n> --\n> .marius\n>\n>\n>\n"},{"id":"70504","messageId":"47C926E8.1000201@trolltech.com","threadId":"12253","inReplyTo":"96c268400802292341y5ac5f287yc5af7afe9aff983a@mail.gmail.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-03-01T09:50:32Z","receivedAt":"2008-03-01T09:50:32Z","isPatch":false,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Maxim Gordienko wrote:\n> No, unfortunately lattest git-p4 does not help. p4 still complain\n> about location of checkout or unable to apply patch(\"file(s) not on\n> client\").\n> My client spec is (p4 itselt is 2007.3)\n> ---\n> Client:\tYOUR-6C9B4BEFA3\n> Update:\t2008/02/22 01:03:06\n> Access:\t2008/03/01 10:32:50\n> Owner:\tfoo\n> Description:\n> \tCreated by foo.\n> Root:\tc:\\p4\n> Options:\tnoallwrite noclobber nocompress unlocked nomodtime normdir\n> SubmitOptions:\tsubmitunchanged\n> LineEnd:\tlocal\n> View:\n> \t//depot/... //YOUR-6C9B4BEFA3/...\n\nHmm, odd. The only thing I can think of is that maybe you have the \nclient spec set up correctly, but you never initially checked out the \nsources into C:\\p4 ?\nTry to run\n     cd /D C:\\ && p4 sync -f ...\nmanually, and then see if you're able to 'git p4 submit'.\n\nOh, and why is Perforce reporting\n     Path 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\nIt seems to me that you're still using the Cygwin version of Perforce, \nis this correct? If so, ensure that you're only using the native \nversion. And please try to remove the Cygwin directories from your PATH \nenvironment variable, so we're sure that Cygwin isn't messing with us \nto. MSys (which the Git Windows port uses) and Cygwin are not that \ncompatible.\n\n--\n.marius\n\n"},{"id":"70518","messageId":"B929D1FF-BAF7-4595-9DAF-07E62B90D767@gmail.com","threadId":"12253","inReplyTo":"96c268400802291048u31a2d8b6ub1726ade941afb8c@mail.gmail.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2008-03-01T11:44:39Z","receivedAt":"2008-03-01T11:44:39Z","isPatch":false,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:\n\n> Thank you, Marius for detailed instructions!\n> Now everything except submitting back to perforce works like a charm.\n> Perforce complains about git-p4 checkout is not under it's root\n>\n> Synchronizing p4 checkout...\n> executing p4 sync ...\n> Path 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n\nI have seen it too. I'm not sure, but it seems to me like even though  \nthe git-p4 script does a chdir(<perforce_dir>) before calling \"p4  \n<command> <args>\" the chdir is \"not seen by\" p4 on windows.\n\nI have a patch on my machine where i simply change all the p4 calls,  \nlike so:\n\nsystem(\"p4 sync ...\") --> system(\"p4 sync %s...\" % self.clientPath)\n\nThis seems to work in all cases, and also in Mac OS X... I can  \nprobably clean the patch up a bit, and submit it later today or  \ntomorrow if you're interested.\n\n      -- Tor Arvid\n"},{"id":"70537","messageId":"47C97C03.8040303@trolltech.com","threadId":"12253","inReplyTo":"B929D1FF-BAF7-4595-9DAF-07E62B90D767@gmail.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Marius Storm-Olsen","fromEmail":"marius@trolltech.com","sentAt":"2008-03-01T15:53:39Z","receivedAt":"2008-03-01T15:53:39Z","isPatch":false,"sender":{"key":"marius@trolltech.com","avatar":"https://gravatar.com/avatar/a40071d8f651862c6ab10bd7996f0ad84d94f06c0399de9e3fa4f06beb390a71?d=mp&s=160"},"body":"Tor Arvid Lund wrote:\n> On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:\n>> Synchronizing p4 checkout... executing p4 sync ... Path\n>> 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n> \n> I have seen it too. I'm not sure, but it seems to me like even though\n> the git-p4 script does a chdir(<perforce_dir>) before calling \"p4 \n> <command> <args>\" the chdir is \"not seen by\" p4 on windows.\n> \n> I have a patch on my machine where i simply change all the p4 calls,\n> like so:\n> \n> system(\"p4 sync ...\") --> system(\"p4 sync %s...\" % self.clientPath)\n> \n> This seems to work in all cases, and also in Mac OS X... I can\n> probably clean the patch up a bit, and submit it later today or\n> tomorrow if you're interested.\n\nIt must mean that you initially didn't have the perforce files synced to \ndisk according to you client spec, so the command to 'cd' into the \nperforce directory failed? I think this problem is solved by just doing a\n     p4 sync //depot/...\nto make sure that all the files exists on disk, before trying the 'git \np4 submit' again.\n\ngit-p4 does not require checked out files to clone from perforce, but \nrequires the files to exist on disk to be able to submit back to the depot.\n\n--\n.marius\n\n"},{"id":"70831","messageId":"96c268400803031124s28e7f5f2s3d0a41ab670477c1@mail.gmail.com","threadId":"12253","inReplyTo":"47C97C03.8040303@trolltech.com","subject":"Re: [GIT-P4] usage under Windows","fromName":"Maxim Gordienko","fromEmail":"mgordienko@gmail.com","sentAt":"2008-03-03T19:24:28Z","receivedAt":"2008-03-03T19:24:28Z","isPatch":false,"sender":{"key":"mgordienko@gmail.com","avatar":null},"body":"Marius, thank you for the tip! but unsynced files not the case. Entire\np4 client dir is in sync with depot.\nbut i found this:\n$ p4 edit 1.txt\n1.txt - file(s) not on client.\n\n$ p4 revert //depot/main/1.txt\n//depot/main/1.txt#21 - was edit, reverted\n\ngit-p4 issues command not pointing on existing file (from p4 point of\nview). So we just need to issue full path in sync command.\n\nOn Sat, Mar 1, 2008 at 6:53 PM, Marius Storm-Olsen <marius@trolltech.com> wrote:\n> Tor Arvid Lund wrote:\n> > On 29. feb.. 2008, at 19.48, Maxim Gordienko wrote:\n> >> Synchronizing p4 checkout... executing p4 sync ... Path\n> >> 'c:/tmp/p42/main\\...' is not under client's root 'c:\\p4'.\n> >\n> > I have seen it too. I'm not sure, but it seems to me like even though\n> > the git-p4 script does a chdir(<perforce_dir>) before calling \"p4\n> > <command> <args>\" the chdir is \"not seen by\" p4 on windows.\n> >\n> > I have a patch on my machine where i simply change all the p4 calls,\n> > like so:\n> >\n> > system(\"p4 sync ...\") --> system(\"p4 sync %s...\" % self.clientPath)\n> >\n> > This seems to work in all cases, and also in Mac OS X... I can\n> > probably clean the patch up a bit, and submit it later today or\n> > tomorrow if you're interested.\n>\n> It must mean that you initially didn't have the perforce files synced to\n> disk according to you client spec, so the command to 'cd' into the\n> perforce directory failed? I think this problem is solved by just doing a\n>     p4 sync //depot/...\n> to make sure that all the files exists on disk, before trying the 'git\n> p4 submit' again.\n>\n> git-p4 does not require checked out files to clone from perforce, but\n> requires the files to exist on disk to be able to submit back to the depot.\n>\n> --\n> .marius\n>\n>\n"}]}