git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Regarding the depreciation of ssh+git/git+ssh protocols

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 15, 2021, 17:56 UTC
Message-ID
<YE+ftT2WaKDzc+45@google.com>
In-Reply-To
<C9Y2DPYH4XO1.3KFD8LT770P2@taiga>
Hi,
Drew DeVault wrote:
Show 7 quoted lines
> c05186cc38ca4605bff1f275619d7d0faeaf2fa5 introduced ssh+git, and
> 07c7782cc8e1f37c7255dfc69c5d0e3f4d4d728c admitted this was a mistake. I
> argue that it was not a mistake.
>
> The main use-case for the git-specific protocol is to disambiguate with
> other version control systems which also use SSH (or HTTPS), such as
> Mercurial, or simply downloading a tarball over HTTP.

Following the trail of links, I reach https://public-inbox.org/git/CA+55aFyWqK0bu2V1SYagrYCBGpj0=2orobK2vT-KRkqpq=kgtw@mail.gmail.com/, but that email mostly just makes assertions rather than explaining the rationale. So it's probably worth talking it through now.

> Some things that are affected by this include package manager source
> lists and configurations for CI tooling (the latter being my main
> interest in this).

The original idea of URI schemes like svn+https is that we can treat these version control URLs as part of the general category of uniform resource identifiers --- in other words, you might be able to type them in a browser's URL bar, browse the content of a repository, use an <img> tag to point to a file within a version control repository, and so on.

_That_ idea, at least, does not work all that well. There's not an equivalent to a fragment identifier to refer to a particular file within a repository. Further, if I have an https URL referring to a Git repository, I'm better off viewing it without a "git+" prefix because then I can see the content of the repository using a web based repository browser.

In other words, a "Git URL" is not a URI at all; it's simply the identifier that Git uses to clone a repository. A package manager or CI tool is perfectly within its rights to provide its own naming scheme for sources, such as "git::https://example.com/path/to/repo" or even the same with "git+" prefix; or it can use an https URL and infer from the content it gets there what version control system it uses.

The missing piece is an HTTP header to unambiguously mark that URL as being usable by Git. I'm not aware of a standard way to do that; e.g. golang's "go get" tool[*] uses a custom 'meta name="go-import"' HTML element.

Thanks and hope that helps, Jonathan

[*] https://golang.org/cmd/go/#hdr-Remote_import_paths
Previous: Drew DeVaultNext: Drew DeVault
Message 2 of 27 in “Regarding the depreciation of ssh+git/git+ssh protocols”
  1. Drew DeVaultMar 15, 2021
  2. Jonathan NiederMar 15, 2021
  3. Drew DeVaultMar 15, 2021
  4. brian m. carlsonMar 15, 2021
  5. Drew DeVaultMar 16, 2021
  6. Jonathan NiederMar 16, 2021
  7. Drew DeVaultMar 16, 2021
  8. Jeff KingMar 16, 2021
  9. Drew DeVaultMar 17, 2021
  10. Junio C HamanoMar 18, 2021
  11. Drew DeVaultMar 18, 2021
  12. Eli SchwartzMar 16, 2021
  13. brian m. carlsonMar 16, 2021
  14. Drew DeVaultMar 16, 2021
  15. Jeff KingMar 16, 2021
  16. Drew DeVaultMar 17, 2021
  17. Jakub NarębskiMar 17, 2021
  18. Drew DeVaultMar 17, 2021
  19. brian m. carlsonMar 17, 2021
  20. Drew DeVaultMar 18, 2021
  21. Eli SchwartzMar 16, 2021
  22. Jonathan NiederMar 17, 2021
  23. Eli SchwartzMar 31, 2021
  24. Mark LodatoApr 7, 2021
  25. Junio C HamanoApr 7, 2021
  26. Kerry, RichardApr 13, 2021
  27. Drew DeVaultMar 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.