[darcs-users] Darcs and a single developer working on multiple workstations

Nimrod A. Abing nimrod.abing at gmail.com
Thu Mar 24 15:52:36 UTC 2005

On Tue, 22 Mar 2005 11:12:48 -0300, Marcus Brito <mbrito at gmail.com> wrote:
> Dear darcs users,
> What would be the best setup for a single developer working on a
> project, on multiple workstations? I'm right now working on a personal
> project, primaraly developed on my home machine. Now and then,
> however, I find myself with lots of free time on my daily job, and it
> would be nice if I could work on my personal project on this time.
> The problem here is keeping both workstations sync'ed. At home, I'm
> free to connect to any host, and I'm not behind a firewall. I have
> access to a FTP site which can later be accessed as HTTP. At work, I'm
> behind draconian firewalls which won't let me connect to anything else
> but HTTP, and even then, only through a complicated chain of
> authenticated proxies. Browsers usually deal OK with these proxies,
> but everything else usually has trouble with them.
> Would darcs help me to work on this setup? If yes, how would be the
> best way to handle to keep the two workstations synchronized?

I am in the same predicament as you are and here is what I do:

1. On my home machine, I set up a "main" repository that I can push
and pull from (e.g. /srv/repo/darcs/SecretProject)
2. I do a darcs get from this repository (cd ~/Projects && darcs get
/srv/repo/darcs/SecretProject) and all work goes into this repository.
3. I create a tarball from the main repository (cd /srv/repo/darcs/ &&
tar cvzf ~/SecretProject.tar.gz SecretProject).
4. I send the SecretProject.tar.gz to my self via GMail.
5. From work I download the SecretProject.tar.gz attachment and untar
it to a directory on my machine there (cd ~/repo/darcs && tar xzvf
~/SecretProject.tar.gz) this now is the "main" repository for the
project on my machine at work.
6. I darcs get from the "main" repository (cd ~/Projects && darcs get
~/repo/darcs/SecretProject) and it becomes the working copy on my
machine at work.

To synchronize to work machine from home machine:

On home machine, do:
1. cd ~/Projects/SecretProject
2. darcs record to record local changes.
3. PATCH_NAME=`date +%Y%m%d`.dpatch darcs send --output=${PATCH_NAME}
&& gzip -9 ${PATCH_NAME} && darcs push
4. Email the resulting patch to my self again via GMail.

On work machine, do:
1. Download and uncompress patch.
2. cd ~/Projects/SecretProject
3. Apply patch using darcs apply, then do a darcs push.

A similar procedure applies when you want to sync your changes made
from work to your home machine. You may need to adjust the commands
above if you are using a non-Unix environment.

It's a bit of a pain to setup at first and hardly elegant. But I hope
it's clear to you what I am suggesting here. Also note, that I do not
use darcs send the directly I use the --output option to generate a
patch file. I have had a bad experience using darcs send to directly
send the patch to my GMail acount. But it was with an old version
(iirc 1.0.1) of darcs that didn't understand Base64 encoding very
well. I don't know if it was darcs or Postfix SMTP that was causing
the problem (patch corruption). I haven't tried direct darcs send with
the latest darcs version 1.0.2.

For all this hassle, is it worth it? For me, yes, and I have been
doing this way ever since. Just don't let the boss catch you working
on your SecretProject on company hours :)

HTH and Good luck.


More information about the darcs-users mailing list