martinvonz / jj

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

git commands with an `sso` origin fail with `Error: invalid argument: 'port'; class=Invalid (3)` #4177

Open antholeole opened 1 month ago

antholeole commented 1 month ago

Description

I have an sso url as a git origin: sso://some-org/some-project. running any jj git command fails with Error: invalid argument: 'port'; class=Invalid (3). jj git fetch, jj git push -b my-branch, etc. It even fails to clone; jj git clone <sso url> fails with the same error.

In practice, I'm attempting to use jj in a google internal gerrit instance.

Steps to Reproduce the Problem

run jj git clone sso://anything which will fail before it attempts to make the api call. I don't think you actually need a sso repository setup, but if a googler looks at this ticket I can provide them my internal gerrit instance url to test it on.

Expected Behavior

it clones the repo

Actual Behavior

it fails with invalid argument port

Specifications

jonathantanmy commented 1 month ago

(I also work for Google.)

URLs of the form sso://... (or anything that is not what you'd expect to be generally supported) work in the Git CLI due to an extension mechanism called remote helpers (https://git-scm.com/docs/gitremote-helpers), but the Git library that jj uses to fetch, libgit2, does not seem to support those. You can reach out internally if you want to discuss options.

ilyagr commented 1 month ago

In principle, we could consider shelling out to git push from jj git push to do the actual pushing, similarly to https://github.com/martinvonz/jj/issues/2920. This would solve other incompatibilities as well. It would be annoying to maintain, though.