git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* ls-remote set timeout
@ 2019-03-08  9:31 Jakobus Schürz
  2019-03-14  9:38 ` Jakobus Schürz
  0 siblings, 1 reply; 3+ messages in thread
From: Jakobus Schürz @ 2019-03-08  9:31 UTC (permalink / raw)
  To: git

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ls-remote set timeout
  2019-03-08  9:31 ls-remote set timeout Jakobus Schürz
@ 2019-03-14  9:38 ` Jakobus Schürz
  2019-03-18  2:34   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jakobus Schürz @ 2019-03-14  9:38 UTC (permalink / raw)
  To: git

ping!

Does anyone has an idea?


Jakob

Am 08.03.19 um 10:31 schrieb Jakobus Schürz:
> 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
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ls-remote set timeout
  2019-03-14  9:38 ` Jakobus Schürz
@ 2019-03-18  2:34   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2019-03-18  2:34 UTC (permalink / raw)
  To: Jakobus Schürz; +Cc: git

Jakobus Schürz <wertstoffe@nurfuerspam.de> writes:

> Does anyone has an idea?

Lack of response generally indicate that people are not interested
but the reason why they are not varies.  It may be because you did
not give them sufficient information about your situation (are you
trying to do this on Windows, for example?).  It may be because you
are looking for a solution that applies only to a narrow situation
that they are not interested in, but by stepping back a bit and by
coming up with a solution that may apply to more general problem may
pique their interest.

Instead of patching "git" to tell it what the connection timeout is,
perhaps a more general command that runs anything and aborts it if
it does not finish within given time period, e.g.

	timeout 180 git ls-remote <REMOTE>

may run "git ls-remote <REMOTE>" but kill it if it does not finish
within 180 seconds.

If you wrote such a general purpose command, that would help you
running ls-remote and abort it if it does not finish within the
given timeout, and also help others who are not using Git but with a
similar need to run other things and kill them when they run for too
long.

Who knows.  If you look for such a command, you might find that one
already exists.  http://lmgtfy.com/?q=run+linux+command+with+timeout

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-18  2:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-08  9:31 ls-remote set timeout Jakobus Schürz
2019-03-14  9:38 ` Jakobus Schürz
2019-03-18  2:34   ` Junio C Hamano

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).