{"thread":{"id":"19176","subject":"bug in git-p4?","startedAt":"2009-05-04T19:20:33Z","lastAt":"2009-05-08T21:46:24Z","messageCount":4,"participants":["Mercier, Carl","Tor Arvid Lund","Carl Mercier","Daniel Barkalow"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"112999","messageId":"F98DA2FE6F6C464C860149518BD861CC3B3C13440A@SSDEXCH2.websense.com","threadId":"19176","inReplyTo":null,"subject":"bug in git-p4?","fromName":"Mercier, Carl","fromEmail":"cmercier@websense.com","sentAt":"2009-05-04T19:20:33Z","receivedAt":"2009-05-04T19:20:33Z","isPatch":false,"sender":{"key":"cmercier@websense.com","avatar":null},"body":"Hello all,\n\nI've been trying to use git-p4 without much success.  My setup is very simple:\n\n- 1 existing Git repo (with data)\n- 1 existing P4 depot (with an empty subdirectory)\n- We commit and push to Git and our company requires all the code to be stored in P4 (in the p4 empty subdir).\n\nHere's what I did:\n\ncd /root/p4-repo/SecTech\ngit clone /home/git/repositories/web website\ncd website\ngit-p4 sync //SecTech/website\ngit branch --track p4-master p4/master\ngit checkout p4-master\ngit merge master\ngit-p4 submit\n\nCRASHES WITH:\nPerforce checkout for depot path //SecTech/website/ located at /root/p4-repo/SecTech/website/\nSyncronizing p4 checkout...\n... - file(s) up-to-date.\nApplying 32a1b2fe93f48c044d04ca37a276fe66afc988ce initial import\n\nfatal: ambiguous argument '32a1b2fe93f48c044d04ca37a276fe66afc988ce^': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions\nCommand failed: git diff-tree -r  \"32a1b2fe93f48c044d04ca37a276fe66afc988ce^\" \"32a1b2fe93f48c044d04ca37a276fe66afc988ce\"\n\n\n\nAm I doing something wrong or is there a bug in git-p4?\n\nI'm a bit confused right now.  Thanks!\n\nCarl\n\n\n Protected by Websense Hosted Email Security -- www.websense.com \n"},{"id":"113341","messageId":"1a6be5fa0905080443h5c696f8es55ea5acf3b3025cb@mail.gmail.com","threadId":"19176","inReplyTo":"F98DA2FE6F6C464C860149518BD861CC3B3C13440A@SSDEXCH2.websense.com","subject":"Re: bug in git-p4?","fromName":"Tor Arvid Lund","fromEmail":"torarvid@gmail.com","sentAt":"2009-05-08T11:43:32Z","receivedAt":"2009-05-08T11:43:32Z","isPatch":false,"sender":{"key":"torarvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/439758?v=4"},"body":"On Mon, May 4, 2009 at 9:20 PM, Mercier, Carl <cmercier@websense.com> wrote:\n> Hello all,\n>\n> I've been trying to use git-p4 without much success.  My setup is very simple:\n>\n> - 1 existing Git repo (with data)\n> - 1 existing P4 depot (with an empty subdirectory)\n> - We commit and push to Git and our company requires all the code to be stored in P4 (in the p4 empty subdir).\n>\n> Here's what I did:\n>\n> cd /root/p4-repo/SecTech\n> git clone /home/git/repositories/web website\n> cd website\n> git-p4 sync //SecTech/website\n> git branch --track p4-master p4/master\n> git checkout p4-master\n> git merge master\n> git-p4 submit\n\nHi. What I try to do at my job, is to consider the P4 depot to be the\n\"master\" depot, since I consider it the \"weaker\" of the two VCSs. I\nhave not had much success doing git merges and then trying to sync\nwith P4. I instead use rebasing a lot. So what I would do in your\nsituation is something like:\n\n...\ngit-p4 sync //SecTech/website\ngit rebase p4/master\ngit-p4 submit\n\nSo.. my normal flow of work is:\n\ncode\ncommit\ncode\ncommit\ngit p4 sync\ngit rebase p4/master\ngit p4 commit\n\nDon't know if this is something that might work for you, though...\n\n-Tor Arvid-\n"},{"id":"113364","messageId":"B82F1DD2-282A-4E3A-ABAE-53F1D0386B25@websense.com","threadId":"19176","inReplyTo":"1a6be5fa0905080443h5c696f8es55ea5acf3b3025cb@mail.gmail.com","subject":"Re: bug in git-p4?","fromName":"Carl Mercier","fromEmail":"cmercier@websense.com","sentAt":"2009-05-08T18:02:26Z","receivedAt":"2009-05-08T18:02:26Z","isPatch":false,"sender":{"key":"cmercier@websense.com","avatar":null},"body":"Thank you.\n\nWhat I'm trying to accomplish is a little bit different. We've been  \nusing Git with a remote server for so long, we don't want to give that  \nup. (and we also can't for some reasons).  So what I was hoping to do  \nwas simply keep working with out remote Git server as normal, and then  \nhave another server pull from Git and submit to P4.\n\nWe have many Git repos we'd like to store into P4 subdirectories.  For  \nexample:\n\nwebsite.git -> //SecTech/website\napi.git -> //SecTech/api\n\nI just can't seem to get this to work because git-p4 seems to expect a  \nbrand new Git repo to work properly.\n\nWhat would be the correct way to accomplish this?\n\nCarl Mercier\nDirector of software development\nDefensio.com, a Websense service\n\n\n\nOn 8-May-09, at 7:43 AM, Tor Arvid Lund wrote:\n\n> On Mon, May 4, 2009 at 9:20 PM, Mercier, Carl  \n> <cmercier@************> wrote:\n>> Hello all,\n>>\n>> I've been trying to use git-p4 without much success.  My setup is  \n>> very simple:\n>>\n>> - 1 existing Git repo (with data)\n>> - 1 existing P4 depot (with an empty subdirectory)\n>> - We commit and push to Git and our company requires all the code  \n>> to be stored in P4 (in the p4 empty subdir).\n>>\n>> Here's what I did:\n>>\n>> cd /root/p4-repo/SecTech\n>> git clone /home/git/repositories/web website\n>> cd website\n>> git-p4 sync //SecTech/website\n>> git branch --track p4-master p4/master\n>> git checkout p4-master\n>> git merge master\n>> git-p4 submit\n>\n> Hi. What I try to do at my job, is to consider the P4 depot to be the\n> \"master\" depot, since I consider it the \"weaker\" of the two VCSs. I\n> have not had much success doing git merges and then trying to sync\n> with P4. I instead use rebasing a lot. So what I would do in your\n> situation is something like:\n>\n> ...\n> git-p4 sync //SecTech/website\n> git rebase p4/master\n> git-p4 submit\n>\n> So.. my normal flow of work is:\n>\n> code\n> commit\n> code\n> commit\n> git p4 sync\n> git rebase p4/master\n> git p4 commit\n>\n> Don't know if this is something that might work for you, though...\n>\n> -Tor Arvid-\n\n\n\n Protected by Websense Hosted Email Security -- www.websense.com \n"},{"id":"113373","messageId":"alpine.LNX.2.00.0905081731510.2147@iabervon.org","threadId":"19176","inReplyTo":"B82F1DD2-282A-4E3A-ABAE-53F1D0386B25@websense.com","subject":"Re: bug in git-p4?","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-05-08T21:46:24Z","receivedAt":"2009-05-08T21:46:24Z","isPatch":false,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Fri, 8 May 2009, Carl Mercier wrote:\n\n> Thank you.\n> \n> What I'm trying to accomplish is a little bit different. We've been using Git\n> with a remote server for so long, we don't want to give that up. (and we also\n> can't for some reasons).  So what I was hoping to do was simply keep working\n> with out remote Git server as normal, and then have another server pull from\n> Git and submit to P4.\n> \n> We have many Git repos we'd like to store into P4 subdirectories.  For\n> example:\n> \n> website.git -> //SecTech/website\n> api.git -> //SecTech/api\n> \n> I just can't seem to get this to work because git-p4 seems to expect a brand\n> new Git repo to work properly.\n\nYou're going to have a whole bunch of problems, most likely, including \nthat Perforce doesn't suppose the history structure that git uses (where a \nrevision can have multiple parents without these revisions having \ndifferent codelines).\n\nMost likely, what you actually want to do is essentially send Perforce \ngit's reflog. You should be able to write a short post-update hook that \ntakes the diff between the before and after, add/edit/delete the files \nthat changed, change a client workspace, and submit it.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}