TMate – new look at the good old CVS

Alexander Kitaev

Alexander Kitaev / Founder and CEO / TMate Software

Formerly a project manager and team leader with TogetherSoft and Borland, Alexander now runs his own company, TMate Software, and works on creating intelligent developer tools that help make teamwork efficient and productive.
You can contact Alexander at: alex at tmate.org.

Last moment note on TMate:

When this article was already sent to the "onBoard" magazine, TMate 1.5 was released and this new release features not only CVS support, but also support for Subversion version control – new and becoming more and more popular VCS. Latest TMate version will unlock Subversion repositories for you as well as CVS ones. You are welcome to TMate Web Site where you may find more details on this new release.

Preface - role of version control system in the development.

There was a moment in time when Intel just introduced their 80386 processor that, comparing with the previous 8086 one, was enriched with protected mode, new addressing modes, 32-bit registers and new commands to operate on those longer registers and address space. However, most system programmers (ones who used assembler language) only used new long registers to compute greater numbers and more memory to store more data. It took a lot of time for some of the programmers to understand, that with the new addressing modes they could make their subroutines faster and more effective, and even implement more complex algorithms using less bytes of code.

The same behavior pattern could be seen in the version control system (VCS) usage. It is hard to imagine now that not a very long time ago there were a lot of software development companies that didn't use VCS at all. Instead, there was a shared hard drive or FTP server with application source code, manual conflict solving, and weekly backups. The stone age of software development process is far away now and it is hard to imagine development infrastructure without a VCS. However modern VCS is frequently perceived as one-way storage systems that resolve conflicts automatically (that is not always true) and make a backup instantly, but in general are still just slightly modified versions of the old code sharing system. Compared with Intel 80386 processor's fate, it is a quantitative, not a qualitative difference between the way people use modern systems and the old time ones. Of course, VCSs themselves have made a huge step forward and continue to progress fast, but we, users of these systems, still underestimate power and value of a VCS in the modern software development process.

Sometimes it is just a question of right tools that helps to use VCS smarter. This article introduces TMate – an IntelliJ IDEA plug-in that helps developers to get most of the CVS – the most popular version control system.

Team Leader's role in software development. How VCS may help.

Modern software development companies consist of different people that play different roles in the product development process. There is a distinct definition of the “product” for each role.

A project manager defines product as a feature matrix or feature tree, Microsoft Project Gantt chart and release schedule. A quality assurance engineer defines product as a complex of functional tests and their actual state. A developer's product is a subsystem source code, and assigned open and closed issues in the bug tracking system. The role for which product is mainly a source code is a team leader – the person who serves as a communication channel between developers and project manager, as a translator from the language of source code to the high level language of project management.

As in virtually any area in software development, it is very dangerous to let the high level project state become disconnected from the actual state of the project. That is why the team leader needs exact and up-to-date information about source code state as a whole at any moment, not relying on the daily or weekly developers' reports. Of course, this information should be easily accessible, and accessible with different levels of detail. It is exactly where VCS should play its role of the important information source, not merely a one-way storage system.

In practice, when using CVS version control system, it is not an easy task to get information out of the CVS. What the user may get is a lot of data which always needs post processing to get the source code state and history overview. This inconvenience, plus an understanding of team leader needs, inspired me to write a TMate – a plug-in that allows me as a team leader to be always in touch with the source code, tracking real project development easily.

During development TMate evolved into something more than just a source code tracking tool and as an IDEA plug-in it additionally provides lot of small but nice features that make work with CVS more convenient. Both team leaders and developers will benefit from using TMate – below I will describe the idea of TMate, the most important features and how they help.

How TMate may help?

To become popular, software has to be usable. When talking about usability, I mean not only UI slimness, but also (and mainly) the way software behaves. Obviously to be usable, an application should be transparent for the user. It should not require additional information to work, should not intervene into the workflow and at the same time be always close, ready to provide necessary information.

When developing TMate my highest priority was to make it exactly this kind of application, otherwise all the additional value provided by the VCS would not worth the effort of retrieving it. That means that TMate shouldn't require any additional information to provide benefits. This is true both on the large process scale where users do not need to change the way they work with VCS, and on the personal workflow level – the TMate plug-in widely uses modeless feedback, standard IDEA controls and keyboard shortcuts, makes collected information easily accessible.

The name of the product – "TMate" is an acronym for "team mate" – ideal team member that doesn't require any attention but does useful work. Now, when first version of TMate is ready I'm glad to say that TMate justifies its name.

To introduce TMate I will first describe its structure and then demonstrate what kind of information TMate may provide for the certain project, and how.

TMate is a combination of a web application and IntelliJ IDEA plug-in:

Figure 1.

The Web application running in an application server (Tomcat 4.0 is included), instantly tracks changes in the CVS repository and represents them as a set of change sets – a concept not supported by CVS, but proved useful in other VCSs. When TMate Server connects to the repository for the first time it indexes all the information that is already there. This may be history for several years of development – TMate indexes it fast, thanks to the smart algorithms implemented in TMate Server.

The TMate web application needs just a read-only access to the CVS repository, which makes it very safe to use and also demonstrates how TMate tries to be transparent, adaptive to the existing environment and thus usable.

The IntelliJ IDEA plug-in contacts TMate Server and displays collected changes. While the web application converts raw data fetched from the CVS repository into meaningful information represented as change sets, TMate plug-in enables you to work with the collected information – browse, search, group, filter, build charts.

TMate in action.

To demonstrate TMate in action, I will take a typical project, configure TMate to track changes in this project and let you see what kind of help you get from TMate. I will use IDEA 4.5.3 and latest version of TMate available in the IDEA plug-in repository.

Installing TMate is very easy, so easy that I won't even describe it in this article. You may find complete installation instructions at TMate documentation page. (Here I may add that it took me around a minute to install TMate with IDEA Plug-in Manager.)

As a typical project that all of you have access to, I will take Jakarta Tomcat that is hosted in the Apache Software Foundation CVS repository. That repository is open for anonymous access and this is enough for TMate. As soon as TMate is installed, it will remind you (with the modeless feedback of course) to configure the TMate web application. In TMate Server configuration, I created a single component named “Tomcat” and filled it with the six modules that I've found in ASF CVS repository.

TMate Tool Window
Figure 2. TMate Tool Window
After applying the new configuration, TMate Server indexed all changes in selected modules and I had to wait no more then three minutes (cool result I suppose, but it depends on a connection speed of course). Of course when TMate server was busy indexing changes nothing prevents me from working in IDEA with an opened project – TMate Server runs in a separate JDK and may run on a different computer as well. TMate server is highly optimized to work fast and with the minimum possible memory footprint – as a good team member that doesn't require others' attention, it requires minimum user and system resources.

So, five minutes after installing TMate, I got a better understanding of what is going on in Jakarta Tomcat project:

The above screenshot demonstrates the main TMate view – an Outlook style tool window with extremely customizable layout. It reuses the time-proven email client mental model, so that there is no need to learn new things. Every modification, like a letter, has date, author and subject - commit message. TMate even marks new modifications as “unread”, so that a single glance at TMate window will let you know whether there are new changes or not.

TMate Tool Window
Figure 3.
By default TMate displays changes for the last month only, to save memory at runtime and network bandwidth, but it is easy to change or remove this limit in TMate's connection configuration:

limit tooltip
Figure 4.
When creating TMate Server configuration, I didn't have a Tomcat project checked out, so now TMate politely suggests me to checkout the configured modules. It takes literally two clicks not only to get Tomcat sources from the CVS, but also to configure project modules corresponding to the CVS ones:

Popup
Figure 5.
As soon as project modules are created source navigation shortcuts start to work in the TMate tool window. (Just don't forget to enable CVS integration in IDEA project properties.) I'm a keyboard-style user and of course all the famous IDEA navigation shortcuts are supported by TMate. I would even say that there is no action in TMate that couldn't be accessed from the keyboard.

TMate's view allows changing its layout completely in a few seconds thus allowing taking a look at the source code from different points of view. For instance first you may be interested in a file's history, then in a history of a user's commits. TMate doesn't require any additional information – it is a tool that displays and lets you access existing CVS data in smart way.

There are predefined layouts and a way to quickly create new ones. Needless to say that TMate, like a good assistant, remembers all the changes you make and, tries whenever possible not make you do the same things again and again.

Users perspective, changes are grouped by modules
Figure 6. Users perspective, changes are grouped by modules
So now, less then ten minutes after installing TMate, I know with some degree of precision:

  • What Tomcat subsystem is under most active development now
  • What problems are being worked on
  • Which developers are working on them
  • What the overall pace of development is

The Tomcat project team uses "Bugzilla" to track bugs and frequently references Bugzilla issues in the commit comments (that is actually a common practice). TMate provides a generic way of integrating source code and bug tracking systems. For the Tomcat project I defined the following regular expression and URL pattern in TMate connections properties:

Users perspective, changes are grouped by modules
Figure 7. Project structure perspective, changes are not grouped
Regular expression to match issues: “Bugzilla (\d+)”

Pattern to generate issue link:

http://issues.apache.org/bugzilla/show_bug.cgi?id=$1

Users perspective, changes are grouped by modules
Figure 8.
Now I may navigate to the issues referenced in commit comments with a single click:

Charts are another representation TMate could provide. Charts give you a certain project aspect overview on a longer-term scale that is not only useful for team leader, but may let team members measure their performance and efficiency in terms of influence on the source code.

All axes are configurable, as well as stacking value. Charts may be saved to gif or exported to CSV for further processing (i.e. in Excel). All the filters applicable to the changes view may be independently applied to the chart.

More TMate Features

There are more TMate features that make a developer's life easier.

The Web interface makes TMate information accessible outside of IDEA, useful when one would like to track latest changes only and either does not have the ability, or would not like to start the whole IDE. The Web interface is not as rich as that of the plug-in, but it gives enough information structured in a way far better than the standard CVS web interface.

Developers will find useful the Local Changes tool window and Pending Updates tab in the changes tool window. These are valuable additions to the standard IDEA CVS integration.

The Local Changes window is similar to the IDEA “commit dialog”, but allows grouping modified files into change sets and committing them separately. And, what is even more important, it is not modal as “commit dialog”. It thus provides convenient navigation from the changes tree to the source code editor and back, and doesn't require the user to go out of the workflow to review changes to be committed. TMate updates the contents of this view automatically, so that it always contains up-to-date information.

Local Changes
Figure 10.

Pending Updates is a view that takes advantage of the constant tracking of the CVS repository and displays project files that were changed by other users and need to be updated. This view allows updating only actually modified files and thus saves a lot of time  especially when working with a large project.

This view also highlights possible conflicts (i.e. files modified both in repository and in the local project) and suggests a way to resolve them faster.

Local Changes
Figure 11.
I wrote this article on a weekend, and Tomcat project didn't contain any changes I should synchronize my project with. So, screenshot below is taken from the other project:

There are lots of other small, mostly invisible features in TMate that make it a pleasure to use and nice to look at, but I think that instead of reading about them in this article you'll have more fun discovering them yourself.

Conclusion

TMate of course is not a silver bullet and will not fit into every development process. First of all it works only with CVS version control. CVS in its turn is quite an old tool and a modern VCS, like Subversion, outweighs it with features. But switching to a new VCS is a time consuming and costly process that not every project can afford. These new VCS may not be as stable as CVS. Subversion, for example, lacks good IDEA integration at the moment.

In such situations TMate may be a valuable tool that brings work with the CVS to a higher level without changing anything in the current infrastructure. It is a transparent tool that is able to give bold results.

If you are interested in TMate you may always find more information and get a trial version at TMate Home Page and for those of you who read this article to this very lines and is working on an open source project I have one more good news to share – TMate is free to use in established open source projects – just send me a reference to your project home page and you will get a license for free.

References:

http://cvshome.org/ - CVS home
http://subversion.tigris.org/- Subversion home
http://tmatesoft.com/documentation/ - TMate online documentation
http://tmate.org/svn/ - JavaSVN library home page