ssh commands fail with dulwich 0.12.0
Created originally on Bitbucket by czarkoff (Dmitrij Czarkoff)
With dulwich 0.12.0 and hggit 0.8.3 I get following:
#!shell
$ hg clone git+ssh://git@github.com/jasperla/openbsd-wip.git
destination directory: openbsd-wip
Invalid command: 'g 'i t - u p l o a d - p a c k ' / j a s p e r l a / o p e n b s d - w i p . g i t '''
You appear to be using ssh to clone a git:// URL.
Make sure your core.gitProxy config option and the
GIT_PROXY_COMMAND environment variable are NOT set.
Apparently the ssh command is treated as list, although it happens to be a string. Seemingly this happens because of this change in dulwich. My local "fix" is:
#!diff
--- hggit/_ssh.py.orig Mon Nov 9 06:41:43 2015
+++ hggit/_ssh.py Mon Dec 21 12:22:04 2015
@@ -14,15 +14,10 @@ def generate_ssh_vendor(ui):
class _Vendor(SSHVendor):
def run_command(self, host, command, username=None, port=None):
- # newer dulwich changes the way they pass command and parameters
- # around, so we detect that here and reformat it back to what
- # hg-git expects (e.g. "command 'arg1 arg2'")
- if len(command) > 1:
- command = ["%s '%s'" % (command[0], ' '.join(command[1:]))]
sshcmd = ui.config("ui", "ssh", "ssh")
args = util.sshargs(sshcmd, host, username, port)
cmd = '%s %s %s' % (sshcmd, args,
- util.shellquote(' '.join(command)))
+ util.shellquote(command))
ui.debug('calling ssh: %s\n' % cmd)
proc = subprocess.Popen(util.quotecommand(cmd), shell=True,
stdin=subprocess.PIPE,