OXPs and version control

Discussion and announcements regarding the Mac port… er, original version of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

OXPs and version control

Post by Ramirez »

This may be one for the Expansions Forum, however it's also Mac-specific so might be better here.

Does anyone out there use version control to help manage development of their OXPs? As my offerings seem to be getting more complex I thought it might be an idea to try putting them under some proper control so I can avoid losing track of things quite so often.

I've been using SVN in a limited capacity for some other minor stuff but I'm not quite sure how best to use it when it comes to OXPs. In particular, is it possible to place a checked-out package directly in the AddOns folder so that it can be modified, run and (if everything goes well) committed, or would it be necessary to hold a working copy somewhere else and transfer files between the two locations in order to commit back to a repository?

Any pointers would be gratefully received.
Download Resistance Commander plus many other exciting OXPs HERE
User avatar
maik
Wiki Wizard
Wiki Wizard
Posts: 2028
Joined: Wed Mar 10, 2010 12:30 pm
Location: Ljubljana, Slovenia (mainly industrial, feudal, TL12)

Re: OXPs and version control

Post by maik »

I use SVN quite regularly for work purposes, but not for OXPs. Generally speaking, you can put any directory under version control, so there is no need to copy between locations. So if you want your work-in-progress OXP to be part of your Oolite add-ons you would put the .oxp folder and all its contents directly under version control.

It would probably be best to have two Oolite installations then: one where you work on your OXPs and a second one which contains a copy of the latest released version of your OXP so that you can easily verify reported bugs. In effect you would create a development environment (which is under version control and subject to frequent changes) and a test environment (which is kept stable).

Hope that helps.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: OXPs and version control

Post by JensAyton »

I do. :-) There are three different test suite OXPs in the Oolite svn repository, plus the debug OXP. The test suites are simply OXPs checked into the repository, while the debug OXP uses a build system like “real” software.

For personal use, you’d probably be better off with a distributed version control system, like Mercurial or Git. These allow you to set up a repository in a folder without requiring a server. (If you’re using a separate server for svn you also get a backup as a side effect, but you can back up a repository like any other directory using normal backup software.)

OXPs in repositories can be put straight into the AddOns directory, and you can do commits and stuff there (I do this with the test suites). For svn, you can check out a subfolder within the repository, which is useful if your repository is a folder with the OXP and additional working files in it (for example, svn checkout svn://example.net/myoxp/myoxp.oxp). You can’t do this with Git, so you’d need to make the root of the repository the OXP. I suspect other DCVSes have the same limitation.

To publish an OXP from svn, use the svn export command to make a copy without the hidden .svn directories. Git and, I believe, all the other “modern” systems use a single hidden folder in the root of the repository, so you can just copy the OXP contents out.
User avatar
Ramirez
---- E L I T E ----
---- E L I T E ----
Posts: 628
Joined: Mon Nov 07, 2005 9:52 am
Location: London, UK

Re: OXPs and version control

Post by Ramirez »

Thanks Ahruman, that's just the kind of info I was after. Will give it a go and see how I get on.
Download Resistance Commander plus many other exciting OXPs HERE
Post Reply