darcs is a source code management system that keeps tracks of all the changes made to files in some directory. In this respect it is the same as Subversion and CVS. However, darcs is distributed, meaning that there is no central repository that needs to be set up. You can set up repositories anywhere and shuttle changes in the form of patches back and forth.
The best darcs reference is at http://wiki.darcs.net/DarcsWiki. However, the instructions are not really clear on how to arrive at a good repository structure to make sure you don't lose your code in a freak accident. If you work exclusively on jones, or exclusively on your own computer, there's no point in having more than one repository for a particular project. Just make sure you back up your computer regularly in case you delete the whole directory or your hard drive crashes.
However, if you're coding on multiple machines, or are working with others, you will probably end up re-creating something like the centralised system SVN and CVS use. In addition to the repository that is in the same directory as your code, you'll need one that's in a neutral place, possibly one that's web accessible if you want people to be able to download the code from anywhere. So you'll end up with a repository in each directory, say in ~/src/project on each machine, and another in a neutral place, maybe ~/Sites/repos/project on jones. Then to trade patches between these repositories, you do the following steps:
darcs pull (optional, if you know that there are changes in the central repository that you want to see)
- Edit the code
darcs record
darcs pull (make sure your just-recorded changes don't conflict with some new changes in the central repository)
darcs push
Remember that the first time you pull or push, you have to provide the full address of the other repository. For example, darcs push username@server.ling.indiana.edu:repos/project. After that, pull and push use the last address if a new one isn't specified.
Useful darcs commands
darcs whatsnew -s --- display a summary of changed files with how many lines have changed
darcs whatsnew -u --- display the changed lines with some context around each change
darcs record --all --- record all changes without confirming each one
These correspond to svn stat, svn diff and svn commit. Unfortunately darcs' user interface is not that great. I suggest writing aliases and shell scripts to make use more convenient.
