{"thread":{"id":"64111","subject":"Git dumb HTTP protocol should use WebDAV PROPFIND method","startedAt":"2025-09-08T12:10:47Z","lastAt":"2025-09-08T19:09:34Z","messageCount":3,"participants":["Milan Hauth","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"525792","messageId":"CAGiEHCv7kXSB5v8Pi6gDYaC2O3m5qEM8dYW3vKvNm6sXQ_Vuhw@mail.gmail.com","threadId":"64111","inReplyTo":null,"subject":"Git dumb HTTP protocol should use WebDAV PROPFIND method","fromName":"Milan Hauth","fromEmail":"milahu@gmail.com","sentAt":"2025-09-08T12:10:34Z","receivedAt":"2025-09-08T12:10:47Z","isPatch":false,"sender":{"key":"milahu@gmail.com","avatar":"https://gravatar.com/avatar/68beefdc29b5666a84773ff8094481ddd56ff3d2f997948c05dedb586574afa9?d=mp&s=160"},"body":"i am serving git repos over http with webdav extensions\n\nread operations like git ls-remote, git fetch, git pull\nshould work with such an http remote\nbut currently (with git 2.49.0) this fails with\n\n$ git ls-remote http://localhost/src/somerepo/\nfatal: repository 'http://localhost/src/somerepo/' not found\n\n$ git ls-remote http://localhost/src/somerepo/.git/\nfatal: repository 'http://localhost/src/somerepo/.git/' not found\n\n\n\nhttp server: nginx\n\nnginx webdav module:\nhttps://github.com/mid1221213/nginx-dav-ext-module\n\nnginx config:\n\n> http {\n>   server {\n>     listen 0.0.0.0:80;\n>     root /var/www/nginx/htdocs;\n>     location /src/ {\n>       # PROPFIND allows directory listing\n>       dav_ext_methods PROPFIND OPTIONS;\n>       dav_access user:r group:r all:r;\n>       autoindex on;\n>       # disable index.html\n>       index this_file_should_never_exist_DsMSIsKgBk;\n>     }\n>   }\n> }\n\navailable methods can be fetched with the OPTIONS method\n\ncurl -s -i -X OPTIONS http://localhost/src/somerepo/ | grep -i ^allow:\n\ndirectory listings can be fetched with the PROPFIND method\n\ncurl -s -X PROPFIND -H \"Depth: 1\"  http://localhost/src/somerepo/ |\ngrep -F 'D:displayname' | sed -E 's|.*>(.*)<.*|\\1|' | LANG=C sort\n\n\n\nworkaround:\n\npushd /path/to/repo/.git/\ngit --bare update-server-info\nmv hooks/post-update.sample hooks/post-update\npopd\ngit ls-remote http://localhost/src/somerepo/.git/\n\n\n\ncontinue:\n\nGit dumb HTTP protocol should work without update-server-info\nhttps://lore.kernel.org/git/CAGiEHCtP29bQRsEyLabNrLuiP96P-o7EEGi88B7pJbP0tfprxw@mail.gmail.com/\n\n> reading directories is only possible with WebDAV since\n> HTTP doesn't offer native directory listing.  However, we don't use\n> WebDAV for fetches and other read operations and not all web servers\n> support it.  We get better web server support in many cases by requiring\n> that the server side do the work of updating the lists of packs and\n> refs.\n"},{"id":"525870","messageId":"xmqqikhswzl7.fsf@gitster.g","threadId":"64111","inReplyTo":"CAGiEHCv7kXSB5v8Pi6gDYaC2O3m5qEM8dYW3vKvNm6sXQ_Vuhw@mail.gmail.com","subject":"Re: Git dumb HTTP protocol should use WebDAV PROPFIND method","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-09-08T18:47:48Z","receivedAt":"2025-09-08T18:47:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Milan Hauth <milahu@gmail.com> writes:\n\n> workaround:\n>\n> pushd /path/to/repo/.git/\n> git --bare update-server-info\n> mv hooks/post-update.sample hooks/post-update\n> popd\n> git ls-remote http://localhost/src/somerepo/.git/\n\nThat is not a workaround, but the proper way the system was designed\nto be used.\n\nAfter all, the \"dumb HTTP\" support is just that.  It is known to be\nultra inefficient relative to other transport methods like \"git\nprotocol over ssh connection\", and \"smart HTTP stateless\nconnection\", and the WHOLE point of supporting \"dumb HTTP\" transport\nis to allow a truly dumb HTTP serving infrastructure.  Letting the\nclients assume that WebDAV exists on the server side defeats its\nreason to exist.\n"},{"id":"525876","messageId":"CAGiEHCuaqu0ia7H8FKAPLcL3Gi_b0gKYe6ugjYAbyVkbd266_w@mail.gmail.com","threadId":"64111","inReplyTo":"xmqqikhswzl7.fsf@gitster.g","subject":"Re: Git dumb HTTP protocol should use WebDAV PROPFIND method","fromName":"Milan Hauth","fromEmail":"milahu@gmail.com","sentAt":"2025-09-08T19:09:20Z","receivedAt":"2025-09-08T19:09:34Z","isPatch":false,"sender":{"key":"milahu@gmail.com","avatar":"https://gravatar.com/avatar/68beefdc29b5666a84773ff8094481ddd56ff3d2f997948c05dedb586574afa9?d=mp&s=160"},"body":"> assume that WebDAV exists on the server side\n\nno\n\nplan A:\nq: GET $url/info/refs\nr: HTTP 404\n\nplan B:\nq: GET $url/.git/info/refs\nr: HTTP 404\n\nplan C:\nq: OPTIONS\nr: Allow: GET,HEAD,PROPFIND,OPTIONS\nq: PROPFIND $url\nr: ...\n\nplan D:\nq: PROPFIND $url/.git/\nr: ...\n\n(q = query, r = response)\n\nso instead of throwing\n\n> fatal: repository '$url' not found\n\ngit should try plan A, B, C, D, ...\nto fetch data from the repo\n\ncurrently, git gives up after plan A\n\n\n\n> the WHOLE point of supporting \"dumb HTTP\" transport\n> is to allow a truly dumb HTTP serving infrastructure\n\nthere are at least 2 variants of \"dumb HTTP servers\":\nHTTP servers without WebDAV\nHTTP servers with WebDAV\n\n\n\n> assume that WebDAV exists on the server side\n\nfor HTTP servers without WebDAV\nsee my other thread\n\nGit dumb HTTP protocol should work without update-server-info\nhttps://lore.kernel.org/git/CAGiEHCtP29bQRsEyLabNrLuiP96P-o7EEGi88B7pJbP0tfprxw@mail.gmail.com/\n"}]}