Document lossy SCP-like SSH URL conversion#2681
Merged
Merged
Conversation
Issue #2467 notes that forcing an SCP-like URL such as `user@host:path/repo` into canonical `ssh://` form collapses it with `user@host:/path/repo`, even though the parsed URL path still keeps the distinction. Git baseline: `git/git/connect.c` parses SCP-like SSH URLs with `:` as the separator, yielding `path/repo`, while `ssh://user@host/path/repo` yields `/path/repo`; Git then quotes that parsed path for the remote service command. Co-authored-by: Sebastian Thiel <[email protected]>
Add unit coverage for the SSH invocation built by gix-transport so the parsed repository path distinction is preserved when invoking `git-upload-pack`. Git baseline: Git's `git/git/connect.c` parses SCP-like URLs with `:` as the separator and URL-form SSH URLs with `/`, then quotes the resulting path into the remote service command. A local fake-SSH check during review showed Git invoking `git-upload-pack 'path/repo'` for SCP-like relative paths and `git-upload-pack '/path/repo'` for URL-form paths. Co-authored-by: Sebastian Thiel <[email protected]>
Sebastian Thiel (Byron)
force-pushed
the
lossy-url-conversion
branch
from
June 29, 2026 07:22
41c070b to
e94565e
Compare
Sebastian Thiel (Byron)
marked this pull request as ready for review
June 29, 2026 07:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by Codex GPT-5.
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #2467
Summary
This documents that forcing an SCP-like SSH URL into canonical
ssh://form is lossy for the relative/path/repodistinction, and adds unit coverage for the SSH upload-pack invocation path that already matches Git.Git Baseline
Git's
/Users/byron/dev/github.com/git/git/connect.cparses SCP-like SSH URLs with:as the separator, so[email protected]:path/repoyieldspath/repo, while URL-formssh://[email protected]/path/repoyields/path/repo. Git then quotes that parsed path into the remote service command.During commit review, a local fake-SSH check also showed Git invoking
git-upload-pack 'path/repo'for the SCP-like relative form andgit-upload-pack '/path/repo'for thessh://form.Changes
ssh://serialization behavior onUrl::serialize_alternate_form(false).handshake().gix-transportunit test pinninggit-upload-packpath arguments for SCP-like andssh://forms.Validation
cargo test -p gix-urlcargo test -p gix-transport --features blocking-client upload_pack_invocation_preserves_scp_like_path_distinction --libcargo test -p gix-transport --features blocking-client --libCommit Reviews
568b0e6710a83a7f19d860a56d2eda3eae478ad4: Codex review found no actionable issues.41c070b2eca5e1f824d4011dab7731e9a444a070: Codex review found no actionable issues.