Version control for user programs

23 Nov 2009

Hello,

I used the simplest/stupidest way to do the version control by naming programs like Foo_V1 and Foo_V2. But along with more and more projects and more and more versions, my "Program Workspace" is a mess.

I tried to use "sub-folders" for the version control like

However, the compiler will compile the both main.cpp files in V1 and V2, and complains multiple defined functions.

To work around this, I modify the main.cpp in V1 and V2 as

main.cpp in V1

#include "version.h"
#ifdef V1

#include "mbed.h"
.....
.....
.....

#endif

and

main.cpp in V2

#include "version.h"
#ifdef V2

#include "mbed.h"
.....
.....
.....

#endif

 

Then add a version.h to define the version V1 or V2

#define V1
 

 

The work-around works. But I am wondering if there is more straight forward, elegant way to do the version control?

Best regards,

Paul

 

23 Nov 2009

You can use cookbook SVN. Some people also requested support for their own SVN servers, maybe it will be implemented.

23 Nov 2009

 

Igor Skochinsky wrote:

You can use cookbook SVN. Some people also requested support for their own SVN servers, maybe it will be implemented.

Thank you Igor. But I would like to keep my programs private instead of publishing them to Cookbook.