On 17/01/14 00:38, Walter Dnes wrote:
On Thu, Jan 16, 2014 at 01:14:28PM +0200, Nikos Chantziaras wrote
With overlays.gentoo.org being down, by update script takes a long time
to complete. Instead of Git telling me immediately that it can't connect
to the server, it just sits there for whole minutes doing nothing before
it decides to abort.
This is extremely frustrating. Is there a way to change this behavior of
Git? Other software doesn't seem to have this problem (for example if I
browse to a web server that's down, the browser immediately tells me
that it can't connect, rather going for a coffee break first.)
Unfortunately, the git client itself can't do this, due to "keepalive"
code built into git. See
http://git.661346.n2.nabble.com/Request-timeout-option-for-remote-operations-esp-quot-git-fetch-quot-td7598943.html
About the only thing you can do is use the "timeout" command to launch
git as a subcommand, e.g.
timeout 1m git fetch
The downside of this approach is that if the git server is feeding
data very slowly, your git client gets killed after the time limit, even
if it's 90% of the way through the download.
This is weird. How can you "keep alive" something that's dead from the
beginning? :-/ AFAIK, "keep alive" in networking refers to keeping an
active connection alive. Here, a connection can't even be established in
the first place. The server is down.