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

git ls-remote: specifying connect timeout / retry limit

From
THTim Heckman <t@heckman.io>
Date
Jan 22, 2019, 08:49 UTC
Message-ID
<CAB=D40guDg_bhFYGCYgpfKkqtMa49u1+=hqBHDWuoNwsQ4sxjw@mail.gmail.com>
Hello,

I've hit a particular situation where I've ran a `git ls-remote` command against a remote Bitbucket repository that resulted in the command hanging for a pretty long amount of time. Running strace shows that the TCP connect call eventually times out, and `git ls-remote` uses a default timeout period meaning it takes awhile to notice. If it retries different IPs, and they all fail, it can take many minutes for "git ls-remote" to return.

Is there a mechanism by which I can configure the connection timeout and retry count to have the `git ls-remote` command fail much faster? For my case I'd like a 15 second timeout and limiting retries to 2. Of course I plan on wrapping the command in a deadline itself, but I'd rather give it a bit more time to pull data if I'm on a slow/latent connection yet it was able to make the initial connection.

Digging through the manpage there's nothing jumping out at me at how to solve this so I thought I'd reach out here.

Cheers! -Tim

Message 1 of 1 in “git ls-remote: specifying connect timeout / retry limit”
  1. Tim HeckmanJan 22, 2019

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.