Path: EDN Asia >> Design Centre >> IC/Board/Systems Design >> How to master version control systems
IC/Board/Systems Design Share print

How to master version control systems

22 Aug 2013  | Jacob Beningo

Share this page with your friends

Version control systems are a great means of sharing source code between developers. They provide the ability for multiple people to simultaneously work on the same code base without the danger of sending files back and forth constantly. Make a mistake while developing and rest assured that the simple press of a button can roll back the code to a fresh square one. History has shown that working without a version control system is a disaster waiting to happen! Version control systems are an essential development tool and there are a number of tips for mastering and getting the most out of these systems.

Tip #1: Commit frequently
Embedded software at times takes on a life of its own and tends to have a temperamental attitude. A developer makes a few minor changes and the entire system destabilises into frenzy. The developer has no fear and reverses the few changes he made and voila! The system is still broken. Without a version control system, the developer now scratches their head in panic and tries to understand what change they made that they don't remember from 5 minutes ago! The engineer using version control on the other hand performs a right click and simply reverts back to the previous working version of the code and now cautiously moves forward. But what if the developer had gone days without committing his code? Days worth of effort could be lost which is why developers using version control should commit frequently! Complete a feature and commit. Get a partial feature working, commit. This will not only save the engineer time when things go wrong but also leave a nice trail in the version control system of the changes that were made.

Tip #2: Fill in the commit log
It is great if an engineer commits their code changes frequently; however, it can prove to be a futile effort if sufficient information is not provided in the change log. Most version control tools will allow comments to be made at the time code is committed. Fill in the log with helpful and useful information! Don't leave it blank or put cryptic information here! In the future, a bug may get introduced into the code and as the developer back tracks the versions, it will be essential that the log contain useful information on what changed. It takes only a few moments and will save many hours of frustration and headaches! Try and come up with a common log format that needs to be filled in before each commit.

Tip #3: Don't forget to add files to the VCS
Version control systems have been known to play a trick or two on a developer. The biggest is when a developer thinks that he is committing code when he actually isn't! How can this happen? Most systems require that when you create a file you add it to revision control. If this isn't done then the system will happily commit and ignore those files that haven't been added! So don't forget to add files to the VCS!

Tip #4: Define a commit process
It is really easy to forget to add files to revision control, properly log changes and a variety of tasks associated with a version control system. The best thing that can be done is to create a process for each of the different tasks that need to be performed.

1 • 2 Next Page Last Page

Want to more of this to be delivered to you for FREE?

Subscribe to EDN Asia alerts and receive the latest design ideas and product news in your inbox.

Got to make sure you're not a robot. Please enter the code displayed on the right.

Time to activate your subscription - it's easy!

We have sent an activate request to your registerd e-email. Simply click on the link to activate your subscription.

We're doing this to protect your privacy and ensure you successfully receive your e-mail alerts.

Add New Comment
Visitor (To avoid code verification, simply login or register with us. It is fast and free!)
*Verify code:
Tech Impact

Regional Roundup
Control this smart glass with the blink of an eye
K-Glass 2 detects users' eye movements to point the cursor to recognise computer icons or objects in the Internet, and uses winks for commands. The researchers call this interface the "i-Mouse."

GlobalFoundries extends grants to Singapore students
ARM, Tencent Games team up to improve mobile gaming

News | Products | Design Features | Regional Roundup | Tech Impact