Tuesday, January 15, 2008

darcs Feature Request

I use darcs all the time. I have 15 repos listed on my website, and at least an additional 10 that haven't made that list yet. The main reason I use version control is for syncronising files between the various computers I use (at least 4 on a regular basis). Of course, having the version control features available as well is an added bonus. I used to use CVS, and its Windows graphical companion, Tortoise CVS, which is a fantastic tool. However, as the Haskell community has migrated to darcs it has become more convenient to standardise on one single tool.

All my darcs repo's are available behind ssh (for pushing to) and behind http (for pulling from). So for example, to pull from the filepath library, I use the http accessible version:

darcs pull http://darcs.haskell.org/packages/filepath/

And to push my changes I do:

darcs push neil@darcs.haskell.org:/home/darcs/packages/filepath

The reason for pulling using http is that this operation doesn't require a public key to be active, doesn't fail if SSH is blocked (which it is in at least one of the locations I regularly visit), and is much quicker.

One feature of darcs is that it saves the last repo address used in a prefs file, so after typing the long darcs pull command the first time, in future I can just type:

darcs pull

Much handier! Unfortunately, if I then do a long-winded push command, it overrides the default repo, and future pull's would go from the ssh path. There is a solution, instead type:

darcs push --no-set-default neil@darcs.haskell.org:/home/darcs/packages/filepath

Ouch! Now that command line is getting a bit of a mouthful. As a result, I pasted this line into a file push.bat, and committed that to the repo. Now I can do the simple darcs pull and a push is as short as:


But this isn't ideal. It's a bit sad that one of the core Hsakell libraries contains a batch script which is platform specific and only works for people with shared keys on my Haskell account (which is now about 10 people...). I'd love to remove this script, which brings me on to...

Feature Request: have darcs allow a different default for push and pull commands.

One way of engineering this would be for darcs to store them entirely separately. Another option would for pull to use the last repo url, and push to use the last repo that wasn't http (since you can't usually push over http). There may be other options that will achieve the same effect.


Anonymous said...


This is also my #1 darcs gripe. Since the ssh method is so much slower and I've got very slow adsl it's really painful to use the ssh method all the time.

I use darcs bash-completion so typing the --no-set-default darcs.haskell.org/blah is not too bad, just "--no-s[tab] d[tab]". Still, it's one more thing to remember.

kowey said...

You could consider putting push --no-set-defaults (or ALL --no-set-defaults) into your _darcs/prefs/defaults. Slightly reduces the pain? Also, maybe --ssh-cm will speed up the SSH based pulling?

Neil Mitchell said...

kowey: it reduces the pain slightly for Duncan, as he can skip part of his typing. For me, I'd still have to remember a ridiculously long path, so its still not feasible.

Anonymous said...

My vote would be for separate pull and push defaults and to change the command line option to be positive (--set-default) rather than negative.

Unknown said...


Your wish sounds reasonable. Please file it in the darcs bug tracker as a "wish" if there is not already something like that there.

Anonymous said...


You're a good Haskell hacker. Maybe you could look into adding this feature and send in a patch for review?

I doubt it would take you very long, it's a good idea and really it just needs to get written. I think the core devs are fairly busy at the moment on 'higher priority' things, like getting darcs2 out.

Neil Mitchell said...

lispy: I don't have the time to compile darcs, let alone patch it. Maybe after my PhD...

Francisco said...

hi my name is francisco, i was investigating in haskell and i want to see the symbol belongs for the simbol(-... tanks a lot...

Neil Mitchell said...

francisco: I think your question might be better asked on the haskell-cafe mailing list: http://www.haskell.org/haskellwiki/Mailing_Lists or the IRC channel: http://www.haskell.org/haskellwiki/IRC_channel