[darcs-users] push --and-apply over ssh uses limited path

Donald Bruce Stewart dons at cse.unsw.edu.au
Mon Mar 1 00:55:49 UTC 2004


Hey,

Push --and-apply uses ssh to exec the command 'darcs apply' on the
remote system. ssh doesn't execute that command in the shell: it
executes it directly, so unless darcs is installed in the system's
default PATH, push won't work.

We can fix this by executing an ssh "sh -lc darcs" instead, so that
users can set up a .profile with any extra environment goo.

This also solves another problem. On my remote system they set the
default umask to 077. This stuffs up group access to my repository when
I push over ssh: every push resets the file modes back to 700.

Anyway, here is a simple patch to fix both problems, allowing for the
user's .profile to be respected.
 
Cheers,
   Don

------------------------------------------------------------------------

--- Push.lhs.orig	Sun Feb 22 04:44:54 2004
+++ Push.lhs	Mon Mar  1 11:17:52 2004
@@ -147,7 +147,7 @@
     runPipe ["darcs","apply","--repodir",repo] bundle
         where (addr,':':path) = break (==':') repo
 apply_via_ssh repo bundle =
-    runPipe ["ssh",addr,"cd '"++path++"' && darcs apply"] bundle
+    runPipe ["ssh",addr,"cd '"++path++"' && sh -l -c 'darcs apply'"] bundle
         where (addr,':':path) = break (==':') repo
 make_email repodir contents bundle boundary =
     "DarcsURL: "++repodir++"\n"++




More information about the darcs-users mailing list