01 June 2015

Step by Step: Version Control with Fossil

Introduction


The purpose of version control system (or revision control system) is to resolve the conflict from set of file changes. For instance, you have edited the code on both tablet and desktop computer.  Figuring out which one is the most recent updated and merging them is an overhead. It becomes more problems if you are not working alone.
This tutorial aims at absolute beginner who likes to try to setup and use Fossil, the modern reversion control system. This tutorial will not go to the details of how revision control was implemented, but will cover the basic use cases including installing, committing code, sharing code, and merging code. This tutorial will try to give a demonstration on GUI tool as much as possible.  Therefore, most command-line will not be explained or even show here.
Before we begin, let have a quick look on version control system. The Figures below show the timeline page of the SQLite source code, the diff view, and issue tracking page.

Timeline View

Diff View

Issue tracking board
Version control has evolved though time. Each architecture of version control has its own advantage and disadvantage. In this tutorial, I will focus only on Fossil, which is distributed version control system (DVCS). Fossil is very easy to setup, and use. Fossil is integrated with web interface, server hosting API, Issue tracking and wiki pages.
As you can notice on the figures above, SQLite, one of the famous database systems, uses Fossil as their version control system.


Installation

The official web page for fossil is located here http://fossil-scm.org/. In my opinion, the command line and web UI are intuitive enough. However, it still lacks of local-files change detection and editable graphical diff tools. For beginner, I recommend the GUI version from here.  The project is called fuel  http://fuelscm.org/.

Installing Fuel

Fuel are cross-platform and portable.
  1. Extracts the downloaded file, and your revision control is now ready to use.
  2. For convenience, you should add your system path with Fuel-1.0.0-win32/.  How to add path?.
  3. To avoid confusion of local and remote web UI, open the fuel.exe and set File>Perference>setting>Web browser> to “Internal”


Installing Graphical Diff Tools

Download the tortoise git from here http://code.google.com/p/tortoisegit/.
Then run commands below to set up the graphical diff tool using TortoiseGitMerge

C:\>fossil setting gdiff "\"C:\Program Files\TortoiseGit\bin\TortoiseGitMerge.exe\""  --global

Terminology

A short description of terminology for version control system are explained below.
  • Repository: Repository is a common storage for the active source files.
  • Artifact/Change-set/Checked-in: A set of editing, adding, and\or removing files in the existing repository.
  • Trunk/Main branch:The version history is display as a tree. Trunk is the main development line.
  • Local/Client computer/machine: Your computer
  • Remote/Server computer/machine/service: Not your computer

 

Advantage of Fossil over Other Version Control Tools

In my opinion, fossil perfectly fit the following situation.
  • Easy to do self-host.
Usually, online services offer free of charge for public repository, which is the perfect choice for open-source project. In case of private repository, most online services offer only a limited usages, unless your pay for full features.
  • Everything is distribution model including issue tracking.
Sometime, we have no computer that can act as a permanent server. With distribution model, the sever can be moved to any computers.
  • No maintenance overhead
Fossil is stand-alone. No need to deal with data base server failure.
  • Can commit and track changes directly from embedded computer.
Web UI is important for dealing with local commit on the embedded computer that does not have 2D monitor.
 
 
 
In the past, centralization model is widely used, but, currently distribution model gain more attention. [http://www.oreilly.com/data/free/data-emerging-trends-and-technologies.csp?intcmp=il-strata-free-lp-data_emerging_trends]
With distribution model, source code and technical board of fossil are always available on your computer.

 
Tools
Timeline view
Issue tracking and wiki page
Subversion + many tools
Centralization
Centralization
Git + GitLab
Distribution
Centralization
Fossil
Distribution
Distribution
 
 
 

No comments:

Post a Comment