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

Re: HTTP repo referencing stale heads (can't clone)

From
NHNick Hengeveld <nickh@reactrix.com>
Date
Apr 4, 2006, 18:01 UTC
Message-ID
<20060404180130.GF14967@reactrix.com>
In-Reply-To
<4431694C.4000007@gentoo.org>
On Mon, Apr 03, 2006 at 07:28:28PM +0100, Daniel Drake wrote:
Show 9 quoted lines
> Ah, should have known. I am behind a (lame) transparent proxy on port 80.
> 
> I opened that file in my web browser and it showed the old heads. After 
> a force-refresh (ctrl+F5, which sends some additionally http headers to 
> refresh the page from the real server), the old heads disappeared, and 
> git now clones successfully.
> 
> git-http-fetch should probably send those extra headers too. I'll try to 
> find some time to look at this next week.

git-http-fetch uses the "Pragma: no-cache" header when requesting objects that shouldn't be cached. Is this the additional header you're referring to?

This patch adds the header to git-ls-remote for the info/refs request.
git-ls-remote: send no-cache header when fetching info/refs

Proxies should not cache this file as it can cause a client to end up with a stale version, as reported here:

http://marc.theaimsgroup.com/?l=git&m=114407944125389
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
---
 git-ls-remote.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
da9b6fa01f1a8bd6ab5f6d4346584f3f032584aa
diff --git a/git-ls-remote.sh b/git-ls-remote.sh
index 2c9a588..b6882a9 100755
--- a/git-ls-remote.sh
+++ b/git-ls-remote.sh
@@ -53,7 +53,7 @@ http://* | https://* )
         if [ -n "$GIT_SSL_NO_VERIFY" ]; then
             curl_extra_args="-k"
         fi
-	curl -nsf $curl_extra_args "$peek_repo/info/refs" ||
+	curl -nsf $curl_extra_args --header "Pragma: no-cache" "$peek_repo/info/refs" ||
 		echo "failed	slurping"
 	;;
 
-- 
1.3.0.rc1.g9aef-dirty
Previous: Daniel DrakeNext: Radoslaw Szkodzinski
Message 10 of 11 in “HTTP repo referencing stale heads (can't clone)”
  1. Daniel DrakeApr 3, 2006
  2. Junio C HamanoApr 3, 2006
  3. Nick HengeveldApr 3, 2006
  4. Junio C HamanoApr 4, 2006
  5. Petr BaudisApr 4, 2006
  6. Nick HengeveldApr 4, 2006
  7. Petr BaudisApr 4, 2006
  8. Nick HengeveldApr 4, 2006
  9. Daniel DrakeApr 3, 2006
  10. Nick HengeveldApr 4, 2006
  11. Radoslaw SzkodzinskiApr 5, 2006

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.