TweetFollow Us on Twitter

Oct 00 Online

Volume Number: 16 (2000)
Issue Number: 10
Column Tag: MacTech Online

CVS: Version Control is Your Friend

by Jeff Clites <online@mactech.com>

CVS, the Concurrent Versions System, is the standard in version control systems in the Unix world. Traditional Mac users may not have used CVS before, and in fact may not have used any version control system, but it can save you numerous headaches during your development projects, and with the arrival of Mac OS X there is no longer any excuse-CVS is free and may even come preinstalled with your developer tools.

So what is a version control system? In short, it allows you to manage and track changes to the files of a project. From an operational standpoint, most systems (including CVS) are based on a central repository which contains all of the files of your project, and individual developers "check out" copies of these files, make changes to their local copies, and then "check in" their changes to the central repository. In the process, the system does three basic things for you: it helps coordinate a team of developers working on the same project (so that programmers don't interfere with other programmers working on the same files); it tracks what changes were made to what file, when they were made, why they were made, and who made them (this helps you identify the cause of a newly introduced bug and helps enforce developer accountability); and it allows you to revert to a version of your project that existed at some previous point in time (this allows you to test compatibility with previous versions or to undo destabilizing changes). Version control isn't a magic bullet or a substitute for communication between developers, but it does go a long way toward preventing common (and annoying) problems. Version control is a must when multiple developers are involved in a project, but even a single developer working alone will benefit.

The main advantage that CVS has over most if its competitors is that it uses optimistic locking rather than pessimistic locking for checked-out file. With pessimistic locking, only one developer can check out and modify a given file at one time, in order to prevent two users from stepping on each others changes in the same file. This sounds like a good idea on the surface, but in practice it can become a major impediment if users keep files checked out for long periods of time, as they would naturally do when editing them, or as they may accidentally do if they forget to check them backing in before leaving for lunch, for the day, or for vacation. Ultimately, users will resort to circumventing the system to obtain a copy of a "locked" file so that they can get some work done, and they'll have to manually reconcile their changes with the user who originally checked out the file. CVS takes a completely different approach-it doesn't lock access to files at all. Multiple users are free to check out and work on the same files at the same time, and the system takes care of merging changes together as users commit their modifications back into the central repository. The majority of the time, users don't actually end up editing the same files at the same time (even though they may have checked them out, for instance to look them over for needed changes), and even when they do CVS is able to merge these changes together automatically. In the rare case in which two users have both modified the same line of code between check-ins, CVS notifies the user of a conflict so that he can resolve it manually. This sound like it could cause a mess, but in practice it usually does just what you would have wanted, and it only makes you spend your time resolving the rare conflict when it actually does occur, rather than causing ongoing interruptions in order to ward off potential problems that never actually arise.

CVS has many strong points in addition to the above-mentioned "non-locking" behavior. For instance, it is open source and licensed under the GPL, and therefore is available free of charge. Also, despite its Unix heritage, there are GUI-based clients available for the classic Mac OS and for Windows. On the other hand, CVS is far from perfect-it has been said that it's terrible but it's the best thing around. Many if its flaws are merely nits, but they can add up to a noticeable inconvenience. To begin with, CVS shares a problem which is unfortunately common among open-source projects, namely that it has a significant amount of documentation yet it is often difficult to find the exact information you are looking for. For example, a very nice feature of CVS is that it can be configure to run over SSH, so that passwords and data are encrypted during transmission. It's hard to find a complete discussion of this feature, and the setup is such that it's easy to think that you've enabled this feature when in fact you haven't. (There also doesn't appear to be a way to force the use of SSH from the server side, i.e. to ensure that clients cannot connect insecurely.)

A second annoyance is the somewhat inconvenient handling of directories. CVS fundamentally works on a per-directory basis, and in each directory it places a "CVS" subdirectory with configuration information. This can cause problems if you duplicate a directory and forget to remove the duplicate CVS information. Under Mac OS X there are many types of "files" which are actually directories, and tools which manipulate these need to be CVS-aware so that they don't remove the CVS information when saving. Some of these "magic directories" (for instance InterfaceBuilder's .nib files) are best thought of as opaque binary files, whose contents should not be manipulated by merge tools, and there is a "wrappers" facility which allows you to treat them as such but, inexplicably, this feature is not compatible with client-server operation. Fortunately, Codefab maintains a modified version of CVS which does support both of these features, although it's a shame that the CVS maintainers don't seem to be interested in merging this back into the core distribution. This still doesn't solve the problem for "magic directories" which you don't want to treat as binary (such as EOModeler's .eomodeld files), but fortunately the latest incarnations of Apple's developer tools seem to handle the CVS directories correctly. For older version, the Omni Group has plug-ins which fix this problem, for both EOModeler and InterfaceBuilder. The directory-centric nature of CVS also has the unpleasant side-effect that you can't really remove a directory from you project - you can only remove the files which it contains. There is a workaround in that there is a setting which tells CVS not to create empty directories during a checkout, but this has the side effect that you can't place an empty directory under version control. (It's rare that you would need to, but it's important to keep in mind in case you ever do.) On a related note, you can place binary files (such as images) under version control, but you have to go through a bit of special configuration to flag them as binary so that CVS doesn't corrupt them, for instance by doing line-ending conversion. Often, these types of files do not really need to be under version-control per se, but it's very convenient to place them in your repository nonetheless so that you can maintain a complete copy of your project, especially in web development projects which tend to contain a large number of image files.

Documentation

Apple itself uses CVS for some of its internal development projects, and in fact Mac OS X Server shipped with it pre-installed. In particular it is used with the Darwin project, and there is a page on their Public Source site which serves as a good jumping-off point to find documentation and other information about CVS. Here you'll find a brief introduction to CVS concepts, by Apple's Wilfredo Sánchez. A good next stop is Jim Blandy's "Introduction to CVS", which goes into a bit more detail. Next up is "Open Source Development with CVS", a book by Karl Fogel. Generously, although this is a commercial book, the chapters on CVS itself are available for free in a variety of electronic formats. It is extensive, well-written, and a pleasant read. Finally, there is the core CVS manual, "Version Management with CVS", colloquially referred to as "the Cederqvist", for the name of its original author. It is large and complete, but it may not be the best place to start out. Finally, for an account of using CVS specifically with web development projects, take a look at "CVS Version Control for Web Site Projects".

Much of the core documentation is located on the main CVS site, CVShome.org, and it's a good place to look for additional information and to download CVS itself, despite the somewhat inconvenient organization of the site. Their documentation page has links to the most important references, including overviews of CVS and of version control, and a CVS commands quick reference. (O'Reilly has also just published their CVS Pocket Reference, if you'd like something a little more extensive and in printed form.) Also check out the CVS Bubbles site, and especially its documentation page, which has links to a number of tutorials and to other CVS sites.

Alternatives

If you're a classic Mac OS user, you'll have to run the CVS server on a Unix machine, but there are several different clients that you can run: MacCVS Pro, MacCvs, and MacCVSClient. Despite their similar names, these are separate applications. The first of these, MacCVS Pro, is sponsored by the Mozilla project, and appears to be the most current version.

Under Mac OS X, CVS should work "out of the box" thanks to the BSD layer. If you don't like the command-line version (which really is quite easy to use), there is a GUI front end, CVL (Concurrent Versions Librarian) by Sen:te. CVL works on top of the standard CVS rather than replacing it. This is nice, because it should be forward-compatible, and it also means that you can resort to the command-line version if there is some additional feature you need to use which CVL doesn't support, and you can do this without worrying that you might "mess up" any of the locally-stored administrative information.

Finally, if CVS isn't to your liking after you've tried it out, there are several alternatives, and you might want to use one of the commercial systems. For the classic Mac OS there is VOODOO (Versions of Outdated Documents Organized Orthogonally). If you need support for multiple platforms, take a look at Perforce, which seems to be well liked and is available for a wide range of operating systems, although there don't appear to be any GUI-based clients for it. (While visiting Perforce's site you might also want to check out JAM, which is a build system designed as an alternative to make, and which is used as the build system under Mac OS X's ProjectBuilder.)

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

FileZilla 3.51.0 - Fast and reliable FTP...
FileZilla (ported from Windows) is a fast and reliable FTP client and server with lots of useful features and an intuitive interface. Version 3.51.0: Bugfixes and minor changes: Fixed import of... Read more
KeyCue 9.8 - Displays all menu shortcut...
KeyCue has always been a handy tool for learning and remembering keyboard shortcuts. With a simple keystroke or click, KeyCue displays a table with all available keyboard shortcuts, system-wide... Read more
AppCleaner 3.5.1 - Uninstall your apps e...
AppCleaner allows you to uninstall your apps easily. It searches the files created by the applications and you can delete them quickly. Version 3.5.1: Fixed a code-signing issue causing AppCleaner... Read more
A Better Finder Attributes 7.03 - Change...
A Better Finder Attributes allows you to change JPEG & RAW shooting dates, JPEG EXIF meta-data tags, file creation & modification dates, file flags and deal with invisible files. Correct EXIF... Read more
Postbox 7.0.33 - Powerful and flexible e...
Postbox is a desktop feature-stuffed email client, news application, and feed reader that helps you manage your work life and increase productivity. Now you can organize all your email accounts in... Read more
Adobe InCopy 16.0 - Create streamlined e...
InCopy is available as part of Adobe Creative Cloud for $52.99/month (or $4.99/month for InCopy app only). Adobe InCopy, ideal for large team projects involving both written copy and design work,... Read more
Steam 2.0 - Multiplayer and communicatio...
Steam is a digital distribution, digital rights management, multiplayer and communications platform developed by Valve Corporation. It is used to distribute a large number of games and related media... Read more
Adobe Lightroom Classic 10.0 - Import, d...
You can download Lightroom for Mac as a part of Creative Cloud for only $9.99/month with Photoshop, included as part of the photography package. The latest version of Lightroom gives you all of the... Read more
Adobe InDesign 16.0 - Professional print...
InDesign is available as part of Adobe Creative Cloud for as little as $20.99/month (or $9.99/month if you're a previous InDesign customer). Adobe InDesign is part of Creative Cloud. That means you... Read more
Adobe After Effects 17.5 - Create profes...
After Effects is available as part of Adobe Creative Cloud for $52.99/month (or $20.99/month for a single app license). The new, more connected After Effects can make the impossible possible. Get... Read more

Latest Forum Discussions

See All

Genshin Impact Currency Guide - What...
Genshin Impact is great fun, but make no mistake: this is a gacha game. It is designed specifically to suck away time and money from you, and one of the ways the game does this is by offering a drip-feed of currencies you will feel compelled to... | Read more »
XCOM 2 Collection on iOS now available f...
The XCOM 2 Collection, which was recently announced to be coming to iOS in November, is now available to pre-order on the App Store. [Read more] | Read more »
Presidents Run has returned for the 2020...
IKIN's popular endless runner Presidents Run has returned to iOS and Android just in time for the 2020 election season. It will see players choosing their favourite candidate and guiding them on a literal run for presidency to gather as many votes... | Read more »
New update for Cookies Must Die adds new...
A new update for Rebel Twins’ platformer shooter Cookies Must Die is coming out this week. The update adds quite a bit to the game, including new levels and characters to play around with. [Read more] | Read more »
Genshin Impact Guide - How to Beat Pyro...
The end game of Genshin Impact largely revolves around spending resin to take on world bosses and clear domain challenges. These fights grant amazing rewards like rare artifacts and ascension materials for weapons and adventurers, but obviously... | Read more »
Moto Rider GO has received a huge update...
Moto Rider GO: Highway Traffic is a popular free-to-play racing game that initially launched back in 2017 and has since racked up over 100 million downloads. Today it has received a sizeable update that introduces several KTM and Husqvarna... | Read more »
ORDESA is a spooky interactive film that...
French studio Cinétévé Experience and ARTE have released interactive movie ORDESA for iOS and Android today. It arrives at the perfect time of year, telling a story about a mysterious haunted house that the viewer suddenly finds themselves lost in... | Read more »
Genshin Impact Guide - How to Beat Storm...
If you've followed our progression guide for Genshin Impact up to Adventure Rank 25, you have reached the point where you can face off against Stormterror on a weekly basis for some pretty sweet rewards. Beating this deadly dragon isn't as easy as... | Read more »
MU Origin 2’s new update welcomes back l...
MU Origin 2 developer Webzen continues to churn out new content for the popular MMORPG and, true to form, it’s just released another update. This one encourages lapsed players to return to the game with the promise of new quests and rewards. [... | Read more »
Genshin Impact Guide - Everything you ne...
Genshin Impact has unveiled its first of what we can expect to be many special events and ongoing content updates. This latest update adds the Elemental Crucible Event. This event is available to any players that have reached Adventure Rank 20,... | Read more »

Price Scanner via MacPrices.net

Apple has 2020 13″ MacBook Airs available sta...
Apple has a full line of Certified Refurbished 2020 13″ MacBook Airs available starting at only $849 and up to $200 off the cost of new Airs. Each MacBook features a new outer case, comes with a... Read more
These major wireless carriers will give you a...
Apple’s wireless partners are offering several deals on iPhone 12 pre-orders right now. If you’re willing to switch carriers, you can get a free iPhone 12 right now. Here’s where to take advantage of... Read more
4 day sale at Sams Club: Save $24-$29 on Appl...
Sams Club has Apple Watch Series 6 GPS models on sale this week for $24-$29 off Apple’s MSRP, starting at $374. Sale ends this Thursday, October 22nd: – 40mm Apple Watch Series 6 GPS: $374.98, save $... Read more
US Cellular offers Apple iPhone 12 Pro for $8...
US Cellular has the 2020 128GB iPhone 12 Pro available for $829 off MSRP for new customers signing up for an Unlimited data plan, or $5.66 per month. Cost of the phone is spread over a 30 month... Read more
Buy one Apple Watch SE or Series 6 at AT&...
Buy one Apple Watch SE or Series 6 at AT&T, and get $200 off the price of a second Apple Watch. One new line required, and price discounted reflected in bill credits over a 30 month period. The... Read more
AT&T offers free iPhone 12, $800 off iPho...
AT&T is offering Apple’s new iPhone 12 for free, or up to $800 off the iPhone 12 Pro, for customers opening a new line of service plus an eligible trade-in. Discount is applied via monthly bill... Read more
US Cellular offers free iPhone 12 for custome...
US Cellular has the 2020 64GB iPhone 12 available for free for new customers signing up for an Unlimited data plan. Cost of the phone is spread over a 30 month period. The fine print: “Promotional... Read more
New Xfinity Mobile promo: Take $250 off Apple...
New customers opening a new line of service can take $250 off the purchase of Apple’s new iPhone 12 or iPhone 23 Pro at Xfinity Mobile through 1/4/21. Service plan required. Their offer reduces the... Read more
New at Verizon: Get the Apple 2020 64GB iPhon...
Verizon is offering the new 2020 64GB iPhone 12 for free for customers switching and opening a new line of service, pre-orders starting at October 16, 2020. They’re offering up to $800 off on 128GB... Read more
Verizon offers the new iPhone 12 Pro for $800...
Verizon is offering the new 2020 iPhone 12 Pro for $800 off MSRP for pre-orders, starting on October 16, 2020. Their offer reduces the price of the 128GB iPhone 12 Pro, for example, to only $199.99... Read more

Jobs Board

Department Manager- Tech Shop/ *Apple* Stor...
…their parents want, and our faculty needs. As a Department Manager in our Tech Shop/ Apple Store you will spend the majority of your time on the sales floor engaging Read more
Geek Squad *Apple* Consultation Professiona...
**782284BR** **Job Title:** Geek Squad Apple Consultation Professional **Job Category:** Store Associates **Store Number or Department:** 000140-San Carlos-Store Read more
*Apple* /Mac IT Support - Randstad (United St...
Apple /Mac IT Support **job details:** + location:San Francisco, CA + salary:$45 - $50 per hour + date posted:Thursday, October 8, 2020 + job type:Contract + Read more
Partner Champion, *Apple* - Insight Network...
Partner Champion, Apple Tempe, AZ, US Requisition Number:78333 As an Apple Partner Champion at Insight, you represent and manage gross profit goals for a valued Read more
Platform - Workplace Eng - *Apple* Enterpri...
MORE ABOUT THIS JOB We are looking for an Apple Platform Engineer who will bring a unique engineering skill set, support, clarity, organization and above all else, Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.