Skip to content

fix: support git+ IRIs#180

Merged
consideRatio merged 7 commits intomainfrom
ap/git-support
Mar 10, 2026
Merged

fix: support git+ IRIs#180
consideRatio merged 7 commits intomainfrom
ap/git-support

Conversation

@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator

@andrius-puksta-sensmetry andrius-puksta-sensmetry commented Feb 20, 2026

  • Fix support for git+ URLs.
  • Make git clones shallow

Tested sysand clone with the following, all pointing to a git repo:

Notes by Erik

Here is how I ran the same tests manually. I ran into unrelated networking issues that confused me initially though.

# git+file test OK
d=$(mktemp -d) && cd "$d" && cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+file:///home/erik/dev/consideratio/sysand-test-project

# git+https test OK
d=$(mktemp -d) && cd "$d" && cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+https://github.com/consideratio/sysand-test-project

# git+ssh test
# - several users likely mistakenly use `:` between host and path, and get "failed to canonicalize iri", an error message that could be improved
d=$(mktemp -d) && cd "$d" && cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+ssh://git@github.com/consideratio/sysand-test-project

# https test OK
d=$(mktemp -d) && cd "$d" && cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone https://github.com/consideratio/sysand-test-project

# ssh test
d=$(mktemp -d) && cd "$d" && cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone ssh://git@github.com/consideratio/sysand-test-project

@andrius-puksta-sensmetry andrius-puksta-sensmetry changed the title Fix git support for cloning, fix docs about git fix: git+ IRIs support for cloning, wrong docs about usages Feb 20, 2026
@andrius-puksta-sensmetry andrius-puksta-sensmetry changed the title fix: git+ IRIs support for cloning, wrong docs about usages fix: support git+ IRIs for cloning, wrong docs about usages Feb 20, 2026
@andrius-puksta-sensmetry andrius-puksta-sensmetry marked this pull request as draft February 27, 2026 16:09
Comment thread docs/src/metadata.md Outdated
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@andrius-puksta-sensmetry andrius-puksta-sensmetry changed the title fix: support git+ IRIs for cloning, wrong docs about usages fix: support git+ IRIs Mar 9, 2026
@andrius-puksta-sensmetry andrius-puksta-sensmetry marked this pull request as ready for review March 9, 2026 12:29
Comment thread docs/src/metadata.md
the project is chosen. The order in which different methods are tried is
unspecified and may change in the future.

Sysand currently supports (i.e. knows how to obtain) these IRI schemes:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see ssh://git, but there seems to be more things supported not examplified here, such as http/https/file sections

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That can wait. ssh://git was specifically mentioned here to prevent people from trying to use the shorthand, as the shorthand is directly given by the GH UI and is the simplest way to refer to a repo (no messing with authentication vars, sysand uses standard OS ssh keys).

I would like to add support for shorthand ssh syntax at some point, as it's the standard way of referring to git repos.

Many more examples could be added here, but I'll leave it for the future:

  • directly referring to a file/directory in a GitHub/GitLab repo
  • public and private repos, explaining authentication (ssh/bearer token)
  • multiple ways of referring to the same stuff: as a git repo/as a file or folder in the repo/as a release asset of the repo/api vs non-api (at least for GitHub)

andrius-puksta-sensmetry and others added 3 commits March 9, 2026 16:19
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
@consideRatio
Copy link
Copy Markdown
Collaborator

consideRatio commented Mar 9, 2026

I'm trying to figure out what is supported, its not obvious to me in order to review and test!

git+file
git+ssh for the same repo, both public and private
ssh for the same public repo
https for the same public repo

# git+file test OK
mkdir -p /tmp/a && cd /tmp/a
cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+https://github.com/consideRatio/sysand-test-project

# git+file test OK
mkdir -p /tmp/b && cd /tmp/b
cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+file:///home/erik/dev/consideRatio/sysand-test-project

# git+ssh test
# - several users likely mistakenly use `:` between host and path, and get "failed to canonicalize iri", an error message that could be improved
# - case sensitive in path, can get stuck if redirected (consideratio instead of consideRatio)
mkdir -p /tmp/c && cd /tmp/c
cargo run --manifest-path ~/dev/sensmetry/sysand/Cargo.toml clone git+ssh://git@github.com/consideRatio/sysand-test-project

Ran out of time to work this further today, gtg from work now!

@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator Author

andrius-puksta-sensmetry commented Mar 9, 2026

I found that git+file:// was case sensitive

The scheme string itself, or the path?

@consideRatio
Copy link
Copy Markdown
Collaborator

I found that git+file:// was case sensitive

The scheme string itself, or the path?

The path -- i had written consideRatio but my folder was named consideratio

@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator Author

# lowercase R in my github username - gets stuck indefinitively
# if i do git clone, this isn't a problem however

Look into this. We use gix, which should match git's behaviour. If fixing requires changes to gix, should at least try to error out and not get stuck.

@andrius-puksta-sensmetry
Copy link
Copy Markdown
Collaborator Author

I found that git+file:// was case sensitive

The scheme string itself, or the path?

The path -- i had written consideRatio but my folder was named consideratio

Why is case sensitivity unexpected? This is a path, and so follows rules of the filesystem/OS.

@consideRatio
Copy link
Copy Markdown
Collaborator

Why is case sensitivity unexpected? This is a path, and so follows rules of the filesystem/OS.

Ah, got thinking it wasn't case sensitive on my system, but it was.

Copy link
Copy Markdown
Collaborator

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had intermittent network issues in the office influencing SSH greatly, but it was unrelated.

I also conclude that you can't do a trivial ":" check to help users towards using / as a separator between host and path, as you may use : like host[:port]/pat, so skipping it for now, and skipping adding tests for now also.

@consideRatio consideRatio merged commit 243032c into main Mar 10, 2026
56 checks passed
@consideRatio consideRatio deleted the ap/git-support branch March 10, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants