On symbol level version control

From Ben's Writing

Jump to: navigation, search

Contents

Introduction

Much work has been done to enhance file level version control systems. There are numerous approaches to file level version control and many of them have been implemented using several different approaches. Modern version control systems allow for such niceties as file operations like renaming or deletion, they also allow for fast branching and tagging.

What all file level version control systems lack, is a method by which to follow language symbols. A reason for this may be that it requires that the tools have intimate knowledge of the grammar of the language they are versioning...

Applications

One of the distinct advantages of symbol level versioning is that lends itself to very powerful, intelligent and easy re-factoring. An example of this might be the practice of "cruft removal". Over the lifetime of many large software projects, a large amount of patch-work accumulates in the crevices of the original infrastructure. In some cases this "cruft" is the result of adding support for a feature that was not anticipated. Using symbol level versioning would allow a developer to roll back in forth in time relative to the symbol they are examining, rather than trudging through file change logs. This fine level of granularity makes it easy to concentrate on current symbol in isolation, and can be used to determine which parts of it can be re-done.

The scope of the symbol is also worth noting. (Maybe this should be called scope level versioning.) That is, a developer could examine a class on its own, or only a single method.

Naive approach

Since there are a number of well equipped file level version control systems, it seems reasonable to use these as a starting point.

  1. Parse the source files for symbol names
  2. Create temporary files (in memory?) for each symbol, using the symbol name as part of the filename, and find the difference between it and the trunk.

The benefit of this approach is that additions, deletions and renaming will be caught by the underling file level version control system.

Dependancies

  1. Language "style sheets". Similar to tidy for HTML, but with a flexible rule-set.
Personal tools