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

ls-remote set timeout

From
JSJakobus Schürz <wertstoffe@nurfuerspam.de>
Date
Mar 8, 2019, 09:31 UTC
Message-ID
<0MUoma-1haJEB1Ckm-00Y6Wl@mail.gmx.com>
Hi there!
Im new to this list - so hello, hope I'm welcome.

My problem is: I have a configuration for my bash saved on a private git-repo. Every time, i start bash, my .bashrc checks this repo out to get all changes (alias, some functions, $PS1 and so on). So i can have my working environment on all my servers with personal login.

Now I'm working on a new customer, where github.com is not reachable (firewall/proxy). Parts of my configuration (some plugins/scripts for vim) cannot be updated there, because they are hosted on github.com. :-/

Now i tried to fiddle in a check, if a repo is reachable in my .bashrc. And i found out, that git ls-remote is a good choice, because it handles redirections from http to https correctly behind this proxy. (direct https links to git-repos do even not work in this surrounding... don't ask why, please).

I can check, if my private repo (git bare repo with gitweb) is reachable (http pull, ssh is also closed!!!) with git ls-remote. But this check hangs on github.com in case of a redirection from the proxy to a "this is forbidden"-site... . And it hangs forever (1 Minute, 2 Minutes or even really forever!)

Is it possible, to include a "--connection-timeout" and/or the "--max-time" option for curl, that i can give to my "git ls-remote" command? So i can call

git --connection-timeout 3 -m 3 ls-remote <REPOURL>

and the command stops after 3 seconds with an errorcode, which I can evaluate?

I tried netcat and curl directly. In this environment only git ls-remote will work correctly on reachable repos, but it hangs on blocked... :-/

Thank you for your interests
Jakob
Next: Jakobus Schürz
Message 1 of 3 in “ls-remote set timeout”
  1. Jakobus SchürzMar 8, 2019
  2. Jakobus SchürzMar 14, 2019
  3. Junio C HamanoMar 18, 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.