git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git dumb HTTP protocol should work without update-server-info
@ 2025-09-07 11:24 Milan Hauth
  2025-09-07 15:07 ` brian m. carlson
  2025-09-08  0:05 ` Jeff King
  0 siblings, 2 replies; 11+ messages in thread
From: Milan Hauth @ 2025-09-07 11:24 UTC (permalink / raw)
  To: git

this works:

git ls-remote /path/to/repo2/
git ls-remote /path/to/repo2/.git/
git ls-remote file:///path/to/repo2/
git ls-remote file:///path/to/repo2/.git/

this fails:

python -m http.server -d /path/to/repo2/ &
git ls-remote http://localhost:8000/
git ls-remote http://localhost:8000/.git/

workaround:

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

expected:
dumb http remotes should behave like file remotes



> git --bare update-server-info

that command creates the file
/path/to/repo2/.git/info/refs
but that is just an optimization
for http servers with high latency

my "dumb" http server
is smart enough to handle http range requests
so there is no need
to download all the files from .git/

but also without http range requests
this should "just work"
and the user should be responsible for optimizations



as another workaround
i tried to mount the .git/ directory with httpdirfs
but httpdirfs fails to mount git repos, see
https://github.com/fangfufu/httpdirfs/issues/183



related:

https://stackoverflow.com/questions/2085402/what-does-git-update-server-info-do

https://stackoverflow.com/questions/2278888/private-git-repository-over-http

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-09-09  5:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-07 11:24 Git dumb HTTP protocol should work without update-server-info Milan Hauth
2025-09-07 15:07 ` brian m. carlson
2025-09-07 17:23   ` Milan Hauth
2025-09-07 17:42     ` brian m. carlson
2025-09-08  9:40   ` Patrick Steinhardt
2025-09-08 14:43     ` Junio C Hamano
2025-09-09  5:26       ` Patrick Steinhardt
2025-09-08  0:05 ` Jeff King
2025-09-08  4:14   ` Junio C Hamano
2025-09-08 21:27   ` brian m. carlson
2025-09-09  1:35     ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).