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:
push
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.
9 comments:
Yes!
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.
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?
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.
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.
Neil,
Your wish sounds reasonable. Please file it in the darcs bug tracker as a "wish" if there is not already something like that there.
Neil,
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.
lispy: I don't have the time to compile darcs, let alone patch it. Maybe after my PhD...
hi my name is francisco, i was investigating in haskell and i want to see the symbol belongs for the simbol(-... tanks a lot...
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
Post a Comment