{"thread":{"id":"60363","subject":"Re: Regarding the depreciation of ssh+git/git+ssh protocols","startedAt":"2023-10-13T20:49:14Z","lastAt":"2023-10-13T20:49:14Z","messageCount":1,"participants":["David Rogers"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"483234","messageId":"CAEAhKry640n-mR7f_6g8TPtEt++ExMTA1K1n6x9XLFMHjCGURA@mail.gmail.com","threadId":"60363","inReplyTo":null,"subject":"Re: Regarding the depreciation of ssh+git/git+ssh protocols","fromName":"David Rogers","fromEmail":"predictivestatmech@gmail.com","sentAt":"2023-10-13T20:49:00Z","receivedAt":"2023-10-13T20:49:14Z","isPatch":false,"sender":{"key":"predictivestatmech@gmail.com","avatar":null},"body":"Git repositories have become indispensable resources for citing parts\nof a development history with links.  However, the format of git\nremote entries is not always distinguishable from other types of\ncitation -- for example a git reference vs. a plain URL.\n\nRather than rely on context to tell me that `https://github.com/git/git`\nrefers to a git repository which I could clone with git over https, it\nwould be nice to use a url like `git+https://github.com/git/git`\nor even\n`git+https://github.com/git/git?commit=d0e8084c65cbf949038ae4cc344ac2c2efd77415`\nto unambiguously specify that the type of data and its method of\naccess are native to git.\n\nThis issue is extremely important for version control systems which\nbuild dependency lists from git, e.g.\nhttps://pip.pypa.io/en/stable/topics/vcs-support/\n\nThat project lists several invented URL schemes (all beginning with\ngit+) and assigning special reserved characters\n(https://datatracker.ietf.org/doc/html/rfc3986#section-2.2)\ngit+https://git.example.com/MyProject.git@master\ngit+https://git.example.com/MyProject.git@v1.0\ngit+https://git.example.com/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709\ngit+https://git.example.com/MyProject.git@refs/pull/123/head\n\nIt would be helpful for the git project itself to define its own URL\nscheme to codify these use cases and, possibly in addition, provide a\nstandard way to reference within git repositories.\n\nFor reference, some of the ways URLs are already used/defined within\ngit are documented here:\n- https://github.com/git/git/blob/d0e8084c65cbf949038ae4cc344ac2c2efd77415/connect.c#L107\n  (alternately, using gitweb syntax not actually available on github,\nhttps://github.com/git/git.git/blob/d0e8084c65cbf949038ae4cc344ac2c2efd77415:/git/connect.c)\n- https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html\n- https://git-scm.com/docs/git-http-backend\n- https://git-scm.com/docs/gitweb\n\nCurrently, a comment in connect.c notes \"git+\" schemes were\ndeprecated.  However, I would argue that at a minimum, these \"git+\"\nschemes should be a supported and documented feature of git.  Also,\nsomething has to be fixed (or better communicated) about URLs of the\nform \"git@github.com:user/project.git\"  These are implicitly treated\nas \"git+ssh://git@github.com/user/project.git\", but the use of \":\" is\nconfusing from the perspective of translating between these two forms.\n\nIn addition, the use of paths, queries, and fragments should be\nconsidered to allow (IMHO) at least 3 distinct uses:\n1. naming commit-ish objects (and potentially metadata like author and\nparents within the commit)\n2. naming tree-ish objects and paths within them\n3. naming blobs (and potentially fragment identifiers like lines or\nHTML tags within those blobs)\n\nThese further refinements don't have to be supported by any special\nfunctions within git.  However, their existence may influence git data\nstructures and api-s in the future.\n\nThe last discussion I can find of this issue on the git mailing list\n(https://lore.kernel.org/git/C9Y2DPYH4XO1.3KFD8LT770P2@taiga)\nindicates that defining conventions like these within git's\ndocumentation would be a good place to start.  On a separate thread, I\nwill send a draft \"git+\" URI naming scheme for discussion and eventual\nsubmission to IANA\n(https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml).\n\n~ David M. Rogers\n"}]}