{"thread":{"id":"50283","subject":"git ls-remote: specifying connect timeout / retry limit","startedAt":"2019-01-22T08:49:54Z","lastAt":"2019-01-22T08:49:54Z","messageCount":1,"participants":["Tim Heckman"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"367291","messageId":"CAB=D40guDg_bhFYGCYgpfKkqtMa49u1+=hqBHDWuoNwsQ4sxjw@mail.gmail.com","threadId":"50283","inReplyTo":null,"subject":"git ls-remote: specifying connect timeout / retry limit","fromName":"Tim Heckman","fromEmail":"t@heckman.io","sentAt":"2019-01-22T08:49:16Z","receivedAt":"2019-01-22T08:49:54Z","isPatch":false,"sender":{"key":"t@heckman.io","avatar":null},"body":"Hello,\n\nI've hit a particular situation where I've ran a `git ls-remote`\ncommand against a remote Bitbucket repository that resulted in the\ncommand hanging for a pretty long amount of time. Running strace shows\nthat the TCP connect call eventually times out, and `git ls-remote`\nuses a default timeout period meaning it takes awhile to notice. If it\nretries different IPs, and they all fail, it can take many minutes for\n\"git ls-remote\" to return.\n\nIs there a mechanism by which I can configure the connection timeout\nand retry count to have the `git ls-remote` command fail much faster?\nFor my case I'd like a 15 second timeout and limiting retries to 2. Of\ncourse I plan on wrapping the command in a deadline itself, but I'd\nrather give it a bit more time to pull data if I'm on a slow/latent\nconnection yet it was able to make the initial connection.\n\nDigging through the manpage there's nothing jumping out at me at how\nto solve this so I thought I'd reach out here.\n\nCheers!\n-Tim\n"}]}