The SSH protocol (ssh://[user@]server/project.git)
The Git protocol (git://example.com/project.git)
The git@server:project.git shorthand is handled by the lib/git/remote.lua parser as if it were a shorthand for the Git protocol, but is in fact a shorthand for the SSH protocol (see the page from the Git Book linked above).
While only used for parsing and not for communicating, this leads for a few issues, especially for self-hosted GitLab installs where you can have urls like "git@gitlab.priv:group/project/repo.git" which weren't correctly handled (noticed as a result of https://github.com/NeogitOrg/neogit/issues/1259#issuecomment-2079268027)
Description
Per the Git Book (https://git-scm.com/book/en/v2/Git-on-the-Server-The-Protocols), the protocols can be the following:
/srv/git/project.git
)https://example.com/gitproject.git
)ssh://[user@]server/project.git
)git://example.com/project.git
)The
git@server:project.git
shorthand is handled by thelib/git/remote.lua
parser as if it were a shorthand for the Git protocol, but is in fact a shorthand for the SSH protocol (see the page from the Git Book linked above).While only used for parsing and not for communicating, this leads for a few issues, especially for self-hosted GitLab installs where you can have urls like "git@gitlab.priv:group/project/repo.git" which weren't correctly handled (noticed as a result of https://github.com/NeogitOrg/neogit/issues/1259#issuecomment-2079268027)
Neovim version
NVIM v0.10.0-dev-2883+g2c5fd3f96-Homebrew Build type: Release LuaJIT 2.1.1710088188
Operating system and version
MacOS 14.4.1
Steps to reproduce
Parse url "git@gitlab.priv:group/project/repo.git". Parse url "ssh://git@gitlab.priv/group/project/repo.git"
Expected behavior
Both should parse correctly and identically. repo should be
repo.git
, owner should begroup/project
Actual behavior
Both parse differently.
Minimal config