Setting GIT_SSH_COMMAND environment variable breaks conversion
Some update has broken my hg
workflow and after some debugging I think it might be hg-git
.
This does not work anymore:
GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa.mykey' hg clone git@github.com:takelwerk/rake-meta.git
But this works:
GIT_GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa.mykey' hg clone git@github.com:takelwerk/rake-meta.git
I've guessed the second line from the error message:
$ GIT_SSH_COMMAND='ssh -i ~/.ssh/id_rsa.mykey' hg clone git@github.com:takelwerk/rake-meta.git
** unknown exception encountered, please report by visiting
** https://mercurial-scm.org/wiki/BugTracker
** Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
** Mercurial Distributed SCM (version 5.6.1)
** Extensions loaded: hggit
Traceback (most recent call last):
File "/usr/bin/hg", line 43, in <module>
dispatch.run()
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 113, in run
status = dispatch(req)
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 303, in dispatch
ret = _runcatch(req) or 0
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 479, in _runcatch
return _callcatch(ui, _runcatchfunc)
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 488, in _callcatch
return scmutil.callcatch(ui, func)
File "/usr/lib/python3/dist-packages/mercurial/scmutil.py", line 153, in callcatch
return func()
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 469, in _runcatchfunc
return _dispatch(req)
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1232, in _dispatch
return runcommand(
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 917, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1244, in _runcommand
return cmdfunc()
File "/usr/lib/python3/dist-packages/mercurial/dispatch.py", line 1230, in <lambda>
d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
File "/usr/lib/python3/dist-packages/mercurial/util.py", line 1867, in check
return func(*args, **kwargs)
File "/usr/lib/python3/dist-packages/mercurial/commands.py", line 1895, in clone
r = hg.clone(
File "/var/lib/mercurial/hgext/hg-git/hggit/schemes.py", line 92, in clone
srcpeer, destpeer = orig(*args, **opts)
File "/usr/lib/python3/dist-packages/mercurial/hg.py", line 928, in clone
exchange.pull(
File "/var/lib/mercurial/hgext/hg-git/hggit/util.py", line 74, in inner
return f(*args, **kwargs)
File "/var/lib/mercurial/hgext/hg-git/hggit/gitrepo.py", line 197, in exchangepull
pullop.cgresult = repo.githandler.fetch(remote, heads)
File "/var/lib/mercurial/hgext/hg-git/hggit/git_handler.py", line 323, in fetch
result = self.fetch_pack(remote.path, heads)
File "/var/lib/mercurial/hgext/hg-git/hggit/git_handler.py", line 1358, in fetch_pack
ret = self._call_client(remote, 'fetch_pack', determine_wants,
File "/var/lib/mercurial/hgext/hg-git/hggit/git_handler.py", line 1395, in _call_client
return func(path, *args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/dulwich/client.py", line 1019, in fetch_pack
proto, can_read, stderr = self._connect(b"upload-pack", path)
File "/usr/local/lib/python3.9/dist-packages/dulwich/client.py", line 1687, in _connect
con = self.ssh_vendor.run_command(
TypeError: run_command() got an unexpected keyword argument 'ssh_command'
It is correct that dulwich
fails because the name of the environment variable is GIT_SSH_COMMAND
and not SSH_COMMAND
. So I guess the problem is one step up which is hg-git
.
I am using hggit external 0.11.0dev (dulwich 0.20.26)
on Debian 11
with Python 3.9.2
.
Edited by Dan Villiom Podlaski Christiansen