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

[PATCH] connect: display connection progress

From
MTMichael S. Tsirkin <mst@dev.mellanox.co.il>
Date
May 6, 2007, 19:52 UTC
Message-ID
<20070506195230.GA30339@mellanox.co.il>

Make git notify the user about host resolution/connection attempts. This is useful both as a progress indicator on slow links, and helps reassure the user there are no DNS/firewall problems.

Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il>
---

I find the following useful. This currently only covers native git protocol. I expect it would be easy to extend this to other protocols, if there's interest. Opinions?

diff --git a/connect.c b/connect.c
index da89c9c..f026713 100644
--- a/connect.c
+++ b/connect.c
@@ -425,9 +425,11 @@ static int git_tcp_connect_sock(char *host)
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = IPPROTO_TCP;
 
+	fprintf(stderr, "Looking up %s ... ", host);
 	gai = getaddrinfo(host, port, &hints, &ai);
 	if (gai)
 		die("Unable to look up %s (port %s) (%s)", host, port, gai_strerror(gai));
+	fprintf(stderr, "done.\nConnecting to %s (port %s) ... ", host, port);
 
 	for (ai0 = ai; ai; ai = ai->ai_next) {
 		sockfd = socket(ai->ai_family,
@@ -450,6 +452,8 @@ static int git_tcp_connect_sock(char *host)
 	if (sockfd < 0)
 		die("unable to connect a socket (%s)", strerror(saved_errno));
 
+	fprintf(stderr, "done.\n");
+
 	return sockfd;
 }
 
-- 
MST
Next: Junio C Hamano
Message 1 of 21 in “connect: display connection progress”
  1. connect: display connection progressMichael S. Tsirkin, May 6, 2007
  2. Junio C HamanoMay 6, 2007
  3. Michael S. TsirkinMay 7, 2007
  4. [PATCHv2] connect: display connection progressMichael S. Tsirkin, May 10, 2007
  5. Alex RiesenMay 10, 2007
  6. Michael S. TsirkinMay 10, 2007
  7. Alex RiesenMay 10, 2007
  8. Michael S. TsirkinMay 10, 2007
  9. Alex RiesenMay 10, 2007
  10. Michael S. TsirkinMay 10, 2007
  11. Alex RiesenMay 10, 2007
  12. Michael S. TsirkinMay 10, 2007
  13. Alex RiesenMay 10, 2007
  14. Michael S. TsirkinMay 10, 2007
  15. Alex RiesenMay 10, 2007
  16. Junio C HamanoMay 10, 2007
  17. Linus TorvaldsMay 10, 2007
  18. Alex RiesenMay 10, 2007
  19. Alex RiesenMay 6, 2007
  20. Michael S. TsirkinMay 7, 2007
  21. Alex RiesenMay 7, 2007

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.