{"thread":{"id":"16568","subject":"git-p4 submit, Can't clobber writable file","startedAt":"2008-12-02T22:30:51Z","lastAt":"2008-12-03T19:06:53Z","messageCount":8,"participants":["Gary Yang","Reece Dunn","Jing Xue","Arafangion"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96990","messageId":"40586.80065.qm@web37902.mail.mud.yahoo.com","threadId":"16568","inReplyTo":null,"subject":"git-p4 submit, Can't clobber writable file","fromName":"Gary Yang","fromEmail":"garyyang6@yahoo.com","sentAt":"2008-12-02T22:30:51Z","receivedAt":"2008-12-02T22:30:51Z","isPatch":false,"sender":{"key":"garyyang6@yahoo.com","avatar":null},"body":"\nI followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n\nBut, I am not able to git-p4 submit. Any idea?\n\ngit-p4 clone //build/scripts build_scripts\ncd build_scripts\nvi foo.h\ngit commit foo.h\ngit-p4 rebase\ngit-p4 submit\n\n  from sets import Set;\nPerforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/\nSyncronizing p4 checkout...\n//build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h\nCan't clobber writable file /home/gyang/workspace/build_scripts/foo.h\n//build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c\nCan't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c\n......\ncommand failed: p4 sync ...\n\nThanks.\n\n\n\n\n\n      \n"},{"id":"96997","messageId":"3f4fd2640812021551t5451e6e3i91e6d2694c89e085@mail.gmail.com","threadId":"16568","inReplyTo":"40586.80065.qm@web37902.mail.mud.yahoo.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Reece Dunn","fromEmail":"msclrhd@googlemail.com","sentAt":"2008-12-02T23:51:48Z","receivedAt":"2008-12-02T23:51:48Z","isPatch":false,"sender":{"key":"msclrhd@googlemail.com","avatar":null},"body":"2008/12/2 Gary Yang <garyyang6@yahoo.com>:\n>\n> I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n>\n> But, I am not able to git-p4 submit. Any idea?\n>\n> git-p4 clone //build/scripts build_scripts\n> cd build_scripts\n> vi foo.h\n> git commit foo.h\n> git-p4 rebase\n> git-p4 submit\n>\n>  from sets import Set;\n> Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/\n> Syncronizing p4 checkout...\n\nThis will be running a `p4 sync ...` command to ensure that the files\nare up-to-date.\n\n> //build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h\n> Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h\n> //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c\n> Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c\n> ......\n> command failed: p4 sync ...\n\nPerforce will mark files as readonly when it does a checkout. When you\nuse `p4 edit` to say you have made changes to the file, Perforce\nremoves the readonly bit.\n\nWhat is happening here is that the sync (checkout) command is trying\nto write foo.h/c to your build_scripts directory, but because they\nalready exist there *and* are not readonly, Perforce is producing that\nerror as it does not want to overwrite any files that have changed\nlocally.\n\nNot sure what is happening on the git-p4 side, though.\n\n- Reece\n"},{"id":"96999","messageId":"94261.93438.qm@web37908.mail.mud.yahoo.com","threadId":"16568","inReplyTo":"3f4fd2640812021551t5451e6e3i91e6d2694c89e085@mail.gmail.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Gary Yang","fromEmail":"garyyang6@yahoo.com","sentAt":"2008-12-03T00:14:05Z","receivedAt":"2008-12-03T00:14:05Z","isPatch":false,"sender":{"key":"garyyang6@yahoo.com","avatar":null},"body":"Reece,\n\nI understand your explanation. But, git-p4 submit does not work for me. Are you able to re-produce the problem?\n\nThanks,\n\nGary\n\n\n--- On Tue, 12/2/08, Reece Dunn <msclrhd@googlemail.com> wrote:\n\n> From: Reece Dunn <msclrhd@googlemail.com>\n> Subject: Re: git-p4 submit, Can't clobber writable file\n> To: garyyang6@yahoo.com\n> Cc: git@vger.kernel.org\n> Date: Tuesday, December 2, 2008, 3:51 PM\n> 2008/12/2 Gary Yang <garyyang6@yahoo.com>:\n> >\n> > I followed the instructions at\n> http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n> >\n> > But, I am not able to git-p4 submit. Any idea?\n> >\n> > git-p4 clone //build/scripts build_scripts\n> > cd build_scripts\n> > vi foo.h\n> > git commit foo.h\n> > git-p4 rebase\n> > git-p4 submit\n> >\n> >  from sets import Set;\n> > Perforce checkout for depot path //build/scripts/\n> located at /home/gyang/workspace/build_scripts/\n> > Syncronizing p4 checkout...\n> \n> This will be running a `p4 sync ...` command to ensure that\n> the files\n> are up-to-date.\n> \n> > //build/scripts/foo.h#1 - added as\n> /home/gyang/workspace/build_scripts/foo.h\n> > Can't clobber writable file\n> /home/gyang/workspace/build_scripts/foo.h\n> > //build/scripts/foo.c#1 - added as\n> /home/gyang/workspace/build_scripts/foo.c\n> > Can't clobber writable file\n> /user/home/gyang/workspace/build_scripts/foo.c\n> > ......\n> > command failed: p4 sync ...\n> \n> Perforce will mark files as readonly when it does a\n> checkout. When you\n> use `p4 edit` to say you have made changes to the file,\n> Perforce\n> removes the readonly bit.\n> \n> What is happening here is that the sync (checkout) command\n> is trying\n> to write foo.h/c to your build_scripts directory, but\n> because they\n> already exist there *and* are not readonly, Perforce is\n> producing that\n> error as it does not want to overwrite any files that have\n> changed\n> locally.\n> \n> Not sure what is happening on the git-p4 side, though.\n> \n> - Reece\n\n\n      \n"},{"id":"97013","messageId":"20081203030729.GB5624@jabba.hq.digizenstudio.com","threadId":"16568","inReplyTo":"40586.80065.qm@web37902.mail.mud.yahoo.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Jing Xue","fromEmail":"jingxue@digizenstudio.com","sentAt":"2008-12-03T03:07:29Z","receivedAt":"2008-12-03T03:07:29Z","isPatch":false,"sender":{"key":"jingxue@digizenstudio.com","avatar":null},"body":"On Tue, Dec 02, 2008 at 02:30:51PM -0800, Gary Yang wrote:\n> \n> I followed the instructions at http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n> \n> But, I am not able to git-p4 submit. Any idea?\n> \n> git-p4 clone //build/scripts build_scripts\n> cd build_scripts\n> vi foo.h\n> git commit foo.h\n> git-p4 rebase\n> git-p4 submit\n> \n>   from sets import Set;\n> Perforce checkout for depot path //build/scripts/ located at /home/gyang/workspace/build_scripts/\n> Syncronizing p4 checkout...\n> //build/scripts/foo.h#1 - added as /home/gyang/workspace/build_scripts/foo.h\n> Can't clobber writable file /home/gyang/workspace/build_scripts/foo.h\n> //build/scripts/foo.c#1 - added as /home/gyang/workspace/build_scripts/foo.c\n> Can't clobber writable file /user/home/gyang/workspace/build_scripts/foo.c\n> ......\n> command failed: p4 sync ...\n\nYou might want to clone to a git working dir different than the p4\nworking dir.\n\nFor instance, if your p4 workspace has the working dir set to\nbuild_scripts/, try 'git p4 clone //build/scripts build_scripts.git'.\n\nYou would then normally work under build_scripts.git/. build_scripts/\nwould only be used by git-p4 at submission time.\n\nCheers.\n-- \nJing Xue\n"},{"id":"97023","messageId":"410584.87710.qm@web37905.mail.mud.yahoo.com","threadId":"16568","inReplyTo":"20081203030729.GB5624@jabba.hq.digizenstudio.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Gary Yang","fromEmail":"garyyang6@yahoo.com","sentAt":"2008-12-03T06:04:20Z","receivedAt":"2008-12-03T06:04:20Z","isPatch":false,"sender":{"key":"garyyang6@yahoo.com","avatar":null},"body":"So, I have to keep two copies of source tree at my home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts. Then, p4 submit code into Perforce. Is this the only way of using git-p4?\nNote: I cannot use git-p4 submit at build_scripts. It claims \"Cannot clobber writable file\". Is it a bug of git-p4 or the instruction is not correct?\n\n\n--- On Tue, 12/2/08, Jing Xue <jingxue@digizenstudio.com> wrote:\n\n> From: Jing Xue <jingxue@digizenstudio.com>\n> Subject: Re: git-p4 submit, Can't clobber writable file\n> To: \"Gary Yang\" <garyyang6@yahoo.com>\n> Cc: git@vger.kernel.org\n> Date: Tuesday, December 2, 2008, 7:07 PM\n> On Tue, Dec 02, 2008 at 02:30:51PM -0800, Gary Yang wrote:\n> > \n> > I followed the instructions at\n> http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n> > \n> > But, I am not able to git-p4 submit. Any idea?\n> > \n> > git-p4 clone //build/scripts build_scripts\n> > cd build_scripts\n> > vi foo.h\n> > git commit foo.h\n> > git-p4 rebase\n> > git-p4 submit\n> > \n> >   from sets import Set;\n> > Perforce checkout for depot path //build/scripts/\n> located at /home/gyang/workspace/build_scripts/\n> > Syncronizing p4 checkout...\n> > //build/scripts/foo.h#1 - added as\n> /home/gyang/workspace/build_scripts/foo.h\n> > Can't clobber writable file\n> /home/gyang/workspace/build_scripts/foo.h\n> > //build/scripts/foo.c#1 - added as\n> /home/gyang/workspace/build_scripts/foo.c\n> > Can't clobber writable file\n> /user/home/gyang/workspace/build_scripts/foo.c\n> > ......\n> > command failed: p4 sync ...\n> \n> You might want to clone to a git working dir different than\n> the p4\n> working dir.\n> \n> For instance, if your p4 workspace has the working dir set\n> to\n> build_scripts/, try 'git p4 clone //build/scripts\n> build_scripts.git'.\n> \n> You would then normally work under build_scripts.git/.\n> build_scripts/\n> would only be used by git-p4 at submission time.\n> \n> Cheers.\n> -- \n> Jing Xue\n\n\n      \n"},{"id":"97069","messageId":"1228302466.23167.1.camel@therock.nsw.bigpond.net.au","threadId":"16568","inReplyTo":"410584.87710.qm@web37905.mail.mud.yahoo.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Arafangion","fromEmail":"thestar@fussycoder.id.au","sentAt":"2008-12-03T11:07:46Z","receivedAt":"2008-12-03T11:07:46Z","isPatch":false,"sender":{"key":"thestar@fussycoder.id.au","avatar":null},"body":"I would argue that's a bug with git-p4, however that is a warning given\nby perforce, thus, you should be able to work around it by changing the\nclientspec, change the clientspec so that it will clobber such files,\nyou will need to refer to the perforce docs for info about that.\n\nOn Tue, 2008-12-02 at 22:04 -0800, Gary Yang wrote:\n> So, I have to keep two copies of source tree at my home directory. One is for Perforce build_scripts workspace, another is for Git build_scripts.git. I normally work at build_scripts.git. But, when I need to submit changes to Perforce, I have to copy changed code from build_scripts.git to build_scripts. Then, p4 submit code into Perforce. Is this the only way of using git-p4?\n> Note: I cannot use git-p4 submit at build_scripts. It claims \"Cannot clobber writable file\". Is it a bug of git-p4 or the instruction is not correct?\n> \n> \n> --- On Tue, 12/2/08, Jing Xue <jingxue@digizenstudio.com> wrote:\n> \n> > From: Jing Xue <jingxue@digizenstudio.com>\n> > Subject: Re: git-p4 submit, Can't clobber writable file\n> > To: \"Gary Yang\" <garyyang6@yahoo.com>\n> > Cc: git@vger.kernel.org\n> > Date: Tuesday, December 2, 2008, 7:07 PM\n> > On Tue, Dec 02, 2008 at 02:30:51PM -0800, Gary Yang wrote:\n> > > \n> > > I followed the instructions at\n> > http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n> > > \n> > > But, I am not able to git-p4 submit. Any idea?\n> > > \n> > > git-p4 clone //build/scripts build_scripts\n> > > cd build_scripts\n> > > vi foo.h\n> > > git commit foo.h\n> > > git-p4 rebase\n> > > git-p4 submit\n> > > \n> > >   from sets import Set;\n> > > Perforce checkout for depot path //build/scripts/\n> > located at /home/gyang/workspace/build_scripts/\n> > > Syncronizing p4 checkout...\n> > > //build/scripts/foo.h#1 - added as\n> > /home/gyang/workspace/build_scripts/foo.h\n> > > Can't clobber writable file\n> > /home/gyang/workspace/build_scripts/foo.h\n> > > //build/scripts/foo.c#1 - added as\n> > /home/gyang/workspace/build_scripts/foo.c\n> > > Can't clobber writable file\n> > /user/home/gyang/workspace/build_scripts/foo.c\n> > > ......\n> > > command failed: p4 sync ...\n> > \n> > You might want to clone to a git working dir different than\n> > the p4\n> > working dir.\n> > \n> > For instance, if your p4 workspace has the working dir set\n> > to\n> > build_scripts/, try 'git p4 clone //build/scripts\n> > build_scripts.git'.\n> > \n> > You would then normally work under build_scripts.git/.\n> > build_scripts/\n> > would only be used by git-p4 at submission time.\n> > \n> > Cheers.\n> > -- \n> > Jing Xue\n> \n> \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"},{"id":"97071","messageId":"20081203142459.GC5624@jabba.hq.digizenstudio.com","threadId":"16568","inReplyTo":"410584.87710.qm@web37905.mail.mud.yahoo.com","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Jing Xue","fromEmail":"jingxue@digizenstudio.com","sentAt":"2008-12-03T14:24:59Z","receivedAt":"2008-12-03T14:24:59Z","isPatch":false,"sender":{"key":"jingxue@digizenstudio.com","avatar":null},"body":"\n(Just a friendly reminder - I believe the convention on this list is \"no\ntop-post.\")\n\nOn Tue, Dec 02, 2008 at 10:04:20PM -0800, Gary Yang wrote:\n> \n> --- On Tue, 12/2/08, Jing Xue <jingxue@digizenstudio.com> wrote:\n>\n> > You might want to clone to a git working dir different than\n> > the p4\n> > working dir.\n> > \n> > For instance, if your p4 workspace has the working dir set\n> > to\n> > build_scripts/, try 'git p4 clone //build/scripts\n> > build_scripts.git'.\n> > \n> > You would then normally work under build_scripts.git/.\n> > build_scripts/\n> > would only be used by git-p4 at submission time.\n>\n> So, I have to keep two copies of source tree at my home directory. One\n> is for Perforce build_scripts workspace, another is for Git\n> build_scripts.git. I normally work at build_scripts.git. But, when I\n> need to submit changes to Perforce, I have to copy changed code from\n> build_scripts.git to build_scripts.\n\nYou don't have to do that, not manually. That's git-p4's job. When you\ndo 'git p4 submit', it basically:\n\n1. calls 'p4 sync' in the p4 working dir,\n2. generates patches from p4/master..HEAD,\n3. for each of the patches, applies it in the p4 working dir, and 'p4\nsubmit' it as one changelist.\n\n> Then, p4 submit code into\n> Perforce. Is this the only way of using git-p4?  Note: I cannot use\n> git-p4 submit at build_scripts. It claims \"Cannot clobber writable\n> file\". Is it a bug of git-p4 or the instruction is not correct?\n\nGit-p4.txt does mention this (although briefly) in the \"Submitting\"\nsection:\n\n\"git-p4 has support for submitting changes from a git repository back to the\nPerforce depot. This requires a Perforce checkout separate from your git\nrepository...\"\n\nCheers.\n-- \nJing Xue\n"},{"id":"97085","messageId":"210854.98218.qm@web37908.mail.mud.yahoo.com","threadId":"16568","inReplyTo":"1228302466.23167.1.camel@therock.nsw.bigpond.net.au","subject":"Re: git-p4 submit, Can't clobber writable file","fromName":"Gary Yang","fromEmail":"garyyang6@yahoo.com","sentAt":"2008-12-03T19:06:53Z","receivedAt":"2008-12-03T19:06:53Z","isPatch":false,"sender":{"key":"garyyang6@yahoo.com","avatar":null},"body":"Arafangion,\n\nI got email from Jing and I solved the problem. The doc should clearly state that we need a separated P4 working dir in order to make git p4 submit work. Many thanks to Jing.\n\nGary\n\n\n--- On Wed, 12/3/08, Arafangion <thestar@fussycoder.id.au> wrote:\n\n> From: Arafangion <thestar@fussycoder.id.au>\n> Subject: Re: git-p4 submit, Can't clobber writable file\n> To: garyyang6@yahoo.com\n> Cc: \"Jing Xue\" <jingxue@digizenstudio.com>, git@vger.kernel.org\n> Date: Wednesday, December 3, 2008, 3:07 AM\n> I would argue that's a bug with git-p4, however that is\n> a warning given\n> by perforce, thus, you should be able to work around it by\n> changing the\n> clientspec, change the clientspec so that it will clobber\n> such files,\n> you will need to refer to the perforce docs for info about\n> that.\n> \n> On Tue, 2008-12-02 at 22:04 -0800, Gary Yang wrote:\n> > So, I have to keep two copies of source tree at my\n> home directory. One is for Perforce build_scripts workspace,\n> another is for Git build_scripts.git. I normally work at\n> build_scripts.git. But, when I need to submit changes to\n> Perforce, I have to copy changed code from build_scripts.git\n> to build_scripts. Then, p4 submit code into Perforce. Is\n> this the only way of using git-p4?\n> > Note: I cannot use git-p4 submit at build_scripts. It\n> claims \"Cannot clobber writable file\". Is it a bug\n> of git-p4 or the instruction is not correct?\n> > \n> > \n> > --- On Tue, 12/2/08, Jing Xue\n> <jingxue@digizenstudio.com> wrote:\n> > \n> > > From: Jing Xue <jingxue@digizenstudio.com>\n> > > Subject: Re: git-p4 submit, Can't clobber\n> writable file\n> > > To: \"Gary Yang\"\n> <garyyang6@yahoo.com>\n> > > Cc: git@vger.kernel.org\n> > > Date: Tuesday, December 2, 2008, 7:07 PM\n> > > On Tue, Dec 02, 2008 at 02:30:51PM -0800, Gary\n> Yang wrote:\n> > > > \n> > > > I followed the instructions at\n> > >\n> http://modular.math.washington.edu/home/mhansen/git-1.5.5.1/contrib/fast-import/git-p4.txt\n> > > > \n> > > > But, I am not able to git-p4 submit. Any\n> idea?\n> > > > \n> > > > git-p4 clone //build/scripts build_scripts\n> > > > cd build_scripts\n> > > > vi foo.h\n> > > > git commit foo.h\n> > > > git-p4 rebase\n> > > > git-p4 submit\n> > > > \n> > > >   from sets import Set;\n> > > > Perforce checkout for depot path\n> //build/scripts/\n> > > located at /home/gyang/workspace/build_scripts/\n> > > > Syncronizing p4 checkout...\n> > > > //build/scripts/foo.h#1 - added as\n> > > /home/gyang/workspace/build_scripts/foo.h\n> > > > Can't clobber writable file\n> > > /home/gyang/workspace/build_scripts/foo.h\n> > > > //build/scripts/foo.c#1 - added as\n> > > /home/gyang/workspace/build_scripts/foo.c\n> > > > Can't clobber writable file\n> > > /user/home/gyang/workspace/build_scripts/foo.c\n> > > > ......\n> > > > command failed: p4 sync ...\n> > > \n> > > You might want to clone to a git working dir\n> different than\n> > > the p4\n> > > working dir.\n> > > \n> > > For instance, if your p4 workspace has the\n> working dir set\n> > > to\n> > > build_scripts/, try 'git p4 clone\n> //build/scripts\n> > > build_scripts.git'.\n> > > \n> > > You would then normally work under\n> build_scripts.git/.\n> > > build_scripts/\n> > > would only be used by git-p4 at submission time.\n> > > \n> > > Cheers.\n> > > -- \n> > > Jing Xue\n> > \n> > \n> >       \n> > --\n> > To unsubscribe from this list: send the line\n> \"unsubscribe git\" in\n> > the body of a message to majordomo@vger.kernel.org\n> > More majordomo info at \n> http://vger.kernel.org/majordomo-info.html\n> \n> --\n> To unsubscribe from this list: send the line\n> \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at \n> http://vger.kernel.org/majordomo-info.html\n\n\n      \n"}]}