Skip to content

FR: Resolve many SSH issues by having networked jj git commands shell out to git #4979

@arxanas

Description

@arxanas

Update: Current status

This is now implemented and released in jj 0.26, but not yet the default. See https://jj-vcs.github.io/jj/latest/config/#git-subprocessing-behaviour. TLDR: jj config set --user git.subprocess=true.


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

Many jj git commands fail on less common setups, oftentimes because libgit2 doesn't support certain features (see additional context).

libgit2 itself uses libssh2 rather than OpenSSH, so it often doesn't behave the way that users would expect with their current git/ssh usage.

We've discussed having jj git commands literally shell out to git, rather than using the libgit2 implementation, most recently in #4937 (comment). I'm opening this issue to justify and track that proposal.

Describe the solution you'd like

Change jj git commands to execute git directly where appropriate.

This is not risk-free. For example, git-branchless does this and instead has issues like git sync --pull, git submit hang indefinitely when asking for password (arxanas/git-branchless#433) (note that it tries to run git in the background and communicate via stdin/stdout). But there are substantially fewer networking-related issues there, so it seems like a better default state of affairs for most users.

Describe alternatives you've considered

  • Continue using libgit2+libssh2: It seems like there's a significant number of issues caused by lack of support in libgit2, to the point that it impedes new and existing users, and we don't have the bandwidth or expertise to address them all.
  • Switch to Gitoxide: I don't think Gitoxide currently supports all of these workflows, and might not in the future. Gitoxide even shells out to git at present for certain use-cases (reading certain config?).

Additional context

Here's my enumeration of issues that might be resolved or resolveable by shelling out to Git. It would be nice if we could mostly solve them with a single mechanism!

SSH:

Clone/fetch/push/pull:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions