I've been playing with darcs lately. It's a really cool version control system that has some wicked features, but somehow has managed to get not just the really insane stuff (really complicated patch management and conflict resolution) right, but also managed to get the little details right.
I had a situation yesterday that involved a conversation that went like this:
Friend: I can't find something that will let me give it a bunch of urls in a web browser and let me download all of them!
Me: I have an hour. Lets write it. Give me a PC.
And so it was on. I had a couple hours to churn out a piece of software, and I wanted to do it in such a way as they could use it and I could maintain it. I also knew that any software I wrote in the space of an hour was going to be a steaming pile of crap.
My weapons of choice: Python, Twisted, Darcs, Putty, Vim.
I wrote most of it over SSH to my OSX machine where I had all the tools installed. Before I started, I created a new directory and typed
darcs init. This initialised that directory as a darcs repo.
When I got it working for the first time (runnable code that did what was required) I typed
darcs record -am "first iteration".
After a few more things I fixed up, I copied it to the windows machine I was doing my work from. I installed Python in
C:\Python24, I grabbed the non-cygwin version of darcs and dragged the contents of that to the same directory. I added
C:\Python24 to the $Path, and killed two birds with one stone. Now
darcs were both in my path, and I could wreak havoc.
darcs get http://shiny.thorne.id.au/~stephen/Downloader/
It worked. I found and fixed bugs using vim on OSX, via putty. Every major change was accompanied by
To test the code on win32, I used
darcs pull -a to suck down the new patches.
Great. It worked. I wanted to show the person I wrote the code for how to use darcs, just in case he made modifications (he intended to do so), so I showed him how to run
darcs record and
darcs send. I operated under the assumption that because he was on a win32 box without an MTA set up correctly, it would fail horribly.
darcs send is a killer feature. Anyone with a checked out darcs repo can use it to send all the darcs patches upstream via SMTP. The patches arrive in the mailbox of the leader developer, and he can choose to apply them or not. No commit access is required. Anyone can do this. People can trade patches in high-fidelity, version controlled fashion.
I could not have been more wrong. It worked fine. It launched thunderbird and sent the email after simple thunderbird "[x] don't ask me again, okay/cancel" click through.
Oh Emm Eff Gee. It worked. Not only did it work, it REALLY worked. No hacking, no unix software installed, no SSH keys or logins. It just worked.
I intend to give a talk at humbug about darcs at some point in the next few weeks. I just have to write up some slides I guess.