To review darcs 2, I reviewed hundreds of bugs entries in the darcs bug tracker, checking to see whether the bugs were fixed are still present. Through this process I became as intimate as the developers with what had been improved in darcs and what remained to address.
What I found was that darcs 2 closed over half the bugs in the bug tracker, literally hundreds of bugs. This was possible because it addressed not just specific bugs, but whole categories of bugs were closed by major architecture and design improvements.
Major bug fixes
- Darcs 1 was unfortunately famous for "hanging" at times as it calculated the resolution of complex patch conflict cases. This was a tough issue to solve, but is largely solved with darcs 2.
- Darcs 2 no longer considers identical patches or patch "hunks" a conflict.
- Darcs 2 has important safety improvements. With new repo formats available to use, darcs 2 is more resistent to repository corruption caused by third parties, like a stray recursive find-and-replace function that gets into the repo directory. It will also create backup files in cases where it did not before.
- Darcs 2 replaces the concept of "partial" repositories with "lazy" ones. There has always been a desire to allow "lightweight" checkouts that don't include the complete repo history. The darcs 1 solution to this was "partial" repositories that only checked out history up to a point. This approach worked to some extent, but didn't play with well with darcs commands that expected the whole history to be present. The new "lazy" concept offers similar benefits, and will pull down older remote patches on demand if some command needs them. Lazy repositories are a great comprise between features and performance.
- Darcs 2 fixes some broken darcs 1 repositories. In some cases a darcs 1 repo could get a bad state so some commands didn't work. Often these repos could be converted into the darcs 2 format, and would be "fixed" when used with darcs 2.
While darcs 1 was and is a useful tool, darcs 2 fixes some significant bugs that restricted some kinds of uses in the past.
To summarize the feature improvements: darcs 2 provides a more polished user experience. Here are highlights of the new features:
- Better progress reporting. In places where the user may need to wait more than a second or two for a response (Say, pulling over HTTP or SSH), darcs 2 is able to give live progress updates. There's often an option to turn up the detail level with '--debug' and '--verbose' flags.
- Performance improvements. Darcs 2 has an option to use a new "global cache" system which speeds up some kinds of operations. Performance when operating over SSH is improved as well. There does remain room for improvement here. Very large projects may not be satisfied with the performance, and "darcs whatsnew --look-for-adds" remains noticeably slow when compared to competing tools.
- Better error messages. Users who run into exceptional cases are more likely to discover error messages that make it clear what to next, without consulting a reference or mailing list.
- Better integration with external tools. Darcs has improved the "post commit hook", allowing better automation for tools would operate on every patch that is pushed to a central repo. The darcs project made direct use of this feature, allowing it to close a bug tracking ticket simply by including the right phrasing in the name of a patch.
- Better handling of binary files. With darcs 2, you can make all the files in particular directory as being binary, rather than just using pattern matching on the file names.
Under the hood
There a few important details to know about what's under the hood of darcs 2.
First, backwards compatibility is in there. There is a strong set of automated tests that insure that darcs 2 works as well as possible with repos in darcs 1 format. You can upgrade to darcs 2 now even if some of the repos you need to access will remain in the darcs 1 format.
Quality Assurance tools have been been improved. While end users won't notice directly, they benefit from the improved quality assurance practices of the darcs project. The large automated test suite is now better organized and more portable. Further, a new "Buildbot" system automates builds of darcs on various platforms, allowing the team to catch portability issues faster.
Deep math? still in there. darcs has always excelled at cherry picking patches from a branch due the patch algebra originally implemented by physicist David Roundy. this unique foundation of the source control system remains and was updated for the new release to support the features described above.
In the community
Between Darcs 1 and Darcs 2, the community continued to release and update related tools that work with Darcs. Some darcs projects worth highlighting include:
- Darcs on Trac. The popular and slick Trac software project management system now supports darcs cleanly through a plugin.
- darcs-graph draws graphs of activity for a darcs repo.
- darcs-monitor notifies users by e-mail of new commits.
- DarcsWatch - tracks unapplied patches on a website.
- Two Mac GUIs appeared, PatchWorks and Darcheology
Adopting Darcs 2
Darcs 2 is an easy upgrade decision for darcs 1 users. Darcs 2 deserves serious consideration for anyone evaluating source code control tools. Be careful reading comparisions of darcs to other options. Most published at the moment still measure against darcs 1, and some cite the now-fixed weaknesses of darcs 1 as reasons not to adopt it. The darcs project is now up front about it's significant limitation: It isn't recommended for very large projects.
The reality is that while some of the weaknesses of Darcs 1.0 were dealbreakers for some users, Darcs 2 is a solid, mature, usable release that deserves a second look.
Thanks for reading! This post is discussed on reddit.