1 |
On Thu, Jan 16, 2014 at 01:14:28PM +0200, Nikos Chantziaras wrote |
2 |
> With overlays.gentoo.org being down, by update script takes a long time |
3 |
> to complete. Instead of Git telling me immediately that it can't connect |
4 |
> to the server, it just sits there for whole minutes doing nothing before |
5 |
> it decides to abort. |
6 |
> |
7 |
> This is extremely frustrating. Is there a way to change this behavior of |
8 |
> Git? Other software doesn't seem to have this problem (for example if I |
9 |
> browse to a web server that's down, the browser immediately tells me |
10 |
> that it can't connect, rather going for a coffee break first.) |
11 |
|
12 |
Unfortunately, the git client itself can't do this, due to "keepalive" |
13 |
code built into git. See |
14 |
http://git.661346.n2.nabble.com/Request-timeout-option-for-remote-operations-esp-quot-git-fetch-quot-td7598943.html |
15 |
|
16 |
About the only thing you can do is use the "timeout" command to launch |
17 |
git as a subcommand, e.g. |
18 |
|
19 |
timeout 1m git fetch |
20 |
|
21 |
The downside of this approach is that if the git server is feeding |
22 |
data very slowly, your git client gets killed after the time limit, even |
23 |
if it's 90% of the way through the download. |
24 |
|
25 |
-- |
26 |
Walter Dnes <waltdnes@××××××××.org> |
27 |
I don't run "desktop environments"; I run useful applications |