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

Git dumb HTTP protocol should use WebDAV PROPFIND method

From
Milan Hauth <milahu@gmail.com>
Date
Sep 8, 2025, 12:10 UTC
Message-ID
<CAGiEHCv7kXSB5v8Pi6gDYaC2O3m5qEM8dYW3vKvNm6sXQ_Vuhw@mail.gmail.com>
i am serving git repos over http with webdav extensions

read operations like git ls-remote, git fetch, git pull should work with such an http remote but currently (with git 2.49.0) this fails with

$ git ls-remote http://localhost/src/somerepo/ fatal: repository 'http://localhost/src/somerepo/' not found

$ git ls-remote http://localhost/src/somerepo/.git/ fatal: repository 'http://localhost/src/somerepo/.git/' not found

http server: nginx

nginx webdav module: https://github.com/mid1221213/nginx-dav-ext-module

nginx config:
Show 14 quoted lines
> http {
>   server {
>     listen 0.0.0.0:80;
>     root /var/www/nginx/htdocs;
>     location /src/ {
>       # PROPFIND allows directory listing
>       dav_ext_methods PROPFIND OPTIONS;
>       dav_access user:r group:r all:r;
>       autoindex on;
>       # disable index.html
>       index this_file_should_never_exist_DsMSIsKgBk;
>     }
>   }
> }
available methods can be fetched with the OPTIONS method
curl -s -i -X OPTIONS http://localhost/src/somerepo/ | grep -i ^allow:
directory listings can be fetched with the PROPFIND method

curl -s -X PROPFIND -H "Depth: 1" http://localhost/src/somerepo/ | grep -F 'D:displayname' | sed -E 's|.*>(.*)<.*|\1|' | LANG=C sort

workaround:

pushd /path/to/repo/.git/ git --bare update-server-info mv hooks/post-update.sample hooks/post-update popd git ls-remote http://localhost/src/somerepo/.git/

continue:

Git dumb HTTP protocol should work without update-server-info https://lore.kernel.org/git/CAGiEHCtP29bQRsEyLabNrLuiP96P-o7EEGi88B7pJbP0tfprxw@mail.gmail.com/

Show 6 quoted lines
> reading directories is only possible with WebDAV since
> HTTP doesn't offer native directory listing.  However, we don't use
> WebDAV for fetches and other read operations and not all web servers
> support it.  We get better web server support in many cases by requiring
> that the server side do the work of updating the lists of packs and
> refs.
Next: Junio C Hamano
Message 1 of 3 in “Git dumb HTTP protocol should use WebDAV PROPFIND method”
  1. Milan HauthSep 8, 2025
  2. Junio C HamanoSep 8, 2025
  3. Milan HauthSep 8, 2025

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.