Jump to content

Edit local file - not in order to submit it - best practice

local edit checkout check-out file

  • Please log in to reply
1 reply to this topic

#1 liran



  • Members
  • Pip
  • 5 posts

Posted 24 March 2014 - 04:43 PM


What is the best practice for editing files, not intended for committing them ?

Details for the scenario:
We have Perforce projects - Java projects.

The '.classpath' files for each projects are included on the project depots.
Every user needs to edit it locally for himself to work - not in order to submit the change.

Sometimes some user do need to submit a change to the '.classpath' file.

As I understand, the options are:
1. Each user can 'check-out' the file (p4 edit) - but then when another user need to commit - many other users have this file opened for edit - can be a conflict ?
2. Change all '.classpath' files type to '+w' Always writable in workspace.
   a. There are a lot of project already on Perforce - this will require work.
   b. What does it mean actually ? Is there a difference on the result or meaning between this and option 1 ? If so, what is it ?
3. Change manually the '.classpath' files to have write permissions - this way actually means that the server does not knows it. Maybe this is the best solution ?
4.... ?


#2 P4Matt


    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 25 March 2014 - 04:05 AM

I'd go with option 1. Preferably I'd rework my classpath file to use only relative paths; then it can be safely checked in and shared among developers without needing specific local changes. Eclipse provides classpath variables to handle external references. With option 2 people are going to get their local changes clobbered which makes for a bad day. Change 3 will have similar problems.

With option 1, if there is a conflict a user can resolve it to work with their local changes. Again though I'd recommend taking a look at how your classpath files are structured. There's rarely a reason to have per developer configurations, and it's going to be very awkward dealing with local dev configurations getting into the shared file. We had a similar issue with one of our Java projects and it was maddening until we fixed it.

Also tagged with one or more of these keywords: local, edit, checkout, check-out, file

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users