Source code revision control

What is the correct practice for keeping track of software projects, which makes sense for microcontroller programs?

I am just a hobby programmer and I currently just keep my programs in folders and edit them as needed. When I get to a point where I think the code is stable I will just copy the program to a new name and start working on that as my new 'release candidate'. But I don't have a system for generating actual releases. Which means I also don't have a good system for rolling back to previous versions. When I go back to fix a bug or add a feature to an older project, it's very hard for me to remember which one of these version files my device is currently running, and which ones are unstable, and so I don't know which one to work on.

I have only a handful of small programs to keep track of, but if I continue to work with AVRs my code base will continue to get bigger and so I would like to start out on the right foot, rather than have to migrate to something later.

I have heard of things like SVN, git, and so on. I gather people used them for software projects but I don't know how they work and I don't know if they make sense for a "one-man shop" which MIGHT expand in the future. I develop on linux and use vi if that makes any difference.

I would be interested in hearing what other people do to keep track of code and code versions, even if it's just a naming scheme. Any advice is appreciated.

1 Like

Hello.
i personally use SVN on my private server for most of my Projects when i know they might be in a constant development.

You can also create local svn repositories relatively easy with tortoisesvn.
http://tortoisesvn.tigris.org/

If you want to work alone. But doing a backup might be harder this way.

If you keep to the recommendet default repository structur with the folders “trunk“ for your ongoing development,
“tags“ for all your release candidates and “branches“ for when you want to change a lot on your code. It looks a lot like you are already doing just without a real versioning system.

I also looked at a lot at other systems like GIT or mercurial. But i love SVN just because its simple to understand system “a folder for everything“.

If you want to try it on a real server environment, i could create a repository for you because i never used a local repository.

Always, always, always put your code under source control. Being a one man shop is not a reason not to do it.

I use Visual Svn Server at home. They have an easy installer for Windows that will give you a Svn repository out of the box (10 minutes). You can also expose it over http, so I can even access my source code from outside my home. I backup the repository (folder structure on file system) to my NAS (where it is copied to a second disk). Restoring is a simple xcopy.

I use AnkhSvn as an Svn client that integrates into Visual Studio but also have TurtoiseSvn installed for Windows Explorer integration. I don't have any experience with Linux, so you have to do some research there.

Git seems to be hot these days, but I have never used it and I understand from colleagues it is not THAT easy to get started with.

So I would recommend Svn in any shape or form.

Git is state of the art version control. There are lots of "getting started" guides out there. Here's one that's thorough and pretty well written: http://hoth.entp.com/output/git_for_designers.html

It's no harder to get started on than any other source code management system. Where git gets tricky is when things get complicated, but you don't seem to need complex features. That said, for your usage, ANY system will be fine, CVS, SVN, Mercurial, Git, just pick one and start using it.

Personally I keep my WIP and test programs in my documents folder which is synced with my dropbox folder.

This gives me very quick access to my sketches from anywhere in the world and there is no messing around re-committing the code (simply save it to My Documents and dropbox does the rest). Dropbox also gives some revision control, as you can view and restore back to previous states.

Once I am happy with the code and want to make it public, I upload it to github.

obiwanjacobi:
Always, always, always put your code under source control. Being a one man shop is not a reason not to do it.

Take this comment serious. There is a statement that says: "There are 2 types of people. The ones that have lost data and the ones that still have to lose data." I fear I belong to both :astonished:

I'm using 2 technologies for my arduino related code (read private time coding). 1 is github. If you want to share your code with the world; it is free (like in you pay nothing). If you want private code you have to pay. It has 1 drawback. you need to push your code yourself to the server.
For code I do not want to share; I use a cloud drive. It sounds similar as to the dropbox Targettio mentions. The biggest advantage is that code gets copied without any need for action on my part. 8) You can call me lazy... I call it convenient. The cloud drive I use is included in a server package so also free (Like in prepaid)

Best regards
Jantje

Jantje:

obiwanjacobi:
Always, always, always put your code under source control. Being a one man shop is not a reason not to do it.

Take this comment serious. There is a statement that says: "There are 2 types of people. The ones that have lost data and the ones that still have to lose data." I fear I belong to both :astonished:

I'm using 2 technologies for my arduino related code (read private time coding). 1 is github. If you want to share your code with the world; it is free (like in you pay nothing). If you want private code you have to pay. It has 1 drawback. you need to push your code yourself to the server.
For code I do not want to share; I use a cloud drive. It sounds similar as to the dropbox Targettio mentions. The biggest advantage is that code gets copied without any need for action on my part. 8) You can call me lazy... I call it convenient. The cloud drive I use is included in a server package so also free (Like in prepaid)

Best regards
Jantje

I don't know anything about cloud drive, but it sounds like a backup solution, not source code control. Ideally you want a source control archive that gets backed up automagically.

I have been dealing with this also, looking for something with near zero maint effort and free. As Maniac said, Git is the flavor of the year, but I don't agree that its easy to use. I have been doing some contracting work and they use Git Hub, and there is a learning curve. Also, Git hub is not really cheap for non-open source. In fact its a bit pricy.

The search continues...

That said, I don't really know what to try. Most of my development is done on a Windows platform so intergration with the file manager would sure be nice. Intergration with Eclipse is nice as well, but I'm not using Eclipse much lately.

skyjumper
I agree that a cloud drive is not a source code control system. Take away a change and configuration management system. But...
My cloud drive contains all te versions back up to 2 years ago of all files. Ok they are not tagged, nor tagable, .... but for home projects I don't care. I have 2 must have requirements:

  1. don't lose code when my system is ..... (stolen/broken...)
  2. Being able to go back to older versions. (the problem is about 30 cm in front of the screen)
    The cloud drive does this very well.
    Best regards
    Jantje

Jantje:
skyjumper
I agree that a cloud drive is not a source code control system. Take away a change and configuration management system. But...
My cloud drive contains all te versions back up to 2 years ago of all files. Ok they are not tagged, nor tagable, .... but for home projects I don't care. I have 2 must have requirements:

  1. don't lose code when my system is ..... (stolen/broken...)
  2. Being able to go back to older versions. (the problem is about 30 cm in front of the screen)
    The cloud drive does this very well.

Yes I can see how it would do that, but usually if you have made a change to one source module, you had to change others to make that work. So when that happens, now you're left to guess which other files you need to bring down to revert. Tagging really is essential. Now if all your apps are just one or two modules, well probably not a big deal. Mine typically have 30 or 40 or more...

I found this:

Its a free Windows based Subversion server, very easy to install.

Of course you don't really need a server for Subversion. You can install this Windows based explorer shell that beo6 linked to earlier:

http://tortoisesvn.tigris.org/

And just establish a repository in your file system. When its time to add developers to your project, you can import the file system repository into a server.

You can use Google code for free and it works fine with nearly any SVN client.

Hi,

Its 2018, has anything changed?
Are there better and simpler tools for source code control for smaller projects with a simple gui?

Thanks and Regards,
WI

https://www.google.com/search?q=TortoiseGit