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

Issue with git clone via http/https and alternates

From
RBRalf Baechle <ralf@linux-mips.org>
Date
Dec 9, 2021, 19:59 UTC
Message-ID
<YbJgEnvuKm+GGXkd@linux-mips.org>

I'm hosting a number of largish repositories which being very similar are using git's alternates feature to save disk and memory. Cloning via git:// or ssh for users with accounts on the server works as expected but cloning via http or https results fails as follows:

$ git clone http://git.linux-mips.org/pub/scm/linux-mti.git Cloning into 'linux-mti'... warning: alternate disabled by http.followRedirects: http://git.linux-mips.org/pub/scm/ralf/linux.git/ error: Unable to find e4add961d4aaeb19f607f6d7bea8d59e1bd39ff0 under http://git.linux-mips.org/pub/scm/linux-mti.git Fetching objects: 11, done. Cannot obtain needed object e4add961d4aaeb19f607f6d7bea8d59e1bd39ff0 while processing commit 9e2bf7cf7d9003c0f06736be5218ed79234f254c. error: fetch failed.

Adding -c http.followRedirects=true will make the clone succeed. Question, shouldn't the default of http.followRedirects=initial already suffice?

Anyway, what I'm looking for is something I can do serverside so users cloning the repository are not bothered with this http.followRedirects business. Is there anything I can do?

Thanks,
  Ralf
Next: Jeff King
Message 1 of 2 in “Issue with git clone via http/https and alternates”
  1. Ralf BaechleDec 9, 2021
  2. Jeff KingDec 10, 2021

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.