martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
9.37k stars 323 forks source link

FR: Support SSH authentication through GIT_SSH_COMMAND #4937

Open ccll opened 4 days ago

ccll commented 4 days ago

Is your feature request related to a problem? Please describe.

We use Coder as remote containerized development environment for the team.

Coder will inject a custom GIT_SSH_COMMAND env var to each user's own workspace container, so the user can authenticate to our private Git server through SSH, as long as the user have added their public key in the Coder Web UI.

The env var looks like this:

GIT_SSH_COMMAND=/tmp/coder.lxnhG0/coder gitssh --

Recently some teammate proposed jj as an advanced alternative to plain git, and we liked it! We wanted to use it in our workflow.

The problem is that jj seems not respecting GIT_SSH_COMMAND so we can't push/pull from our Git server from within the Coder container.

Describe the solution you'd like

Let jj respect GIT_SSH_COMMAND.

Describe alternatives you've considered N/A

Additional context N/A

martinvonz commented 4 days ago

We currently use libgit2 in jj git push. We might switch to subprocessing to regular git push instead. That would solve a lot of problems with compatibility. It would probably solve this issue too.