<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -45,7 +45,7 @@ static int run_remote_archiver(const char *remote, int argc,
 	}
 
 	url = xstrdup(remote);
-	pid = git_connect(fd, url, exec);
+	pid = git_connect(fd, url, exec, 0);
 	if (pid &lt; 0)
 		return pid;
 </diff>
      <filename>builtin-archive.c</filename>
    </modified>
    <modified>
      <diff>@@ -463,7 +463,8 @@ struct ref {
 #define REF_HEADS	(1u &lt;&lt; 1)
 #define REF_TAGS	(1u &lt;&lt; 2)
 
-extern pid_t git_connect(int fd[2], char *url, const char *prog);
+#define CONNECT_VERBOSE       (1u &lt;&lt; 0)
+extern pid_t git_connect(int fd[2], char *url, const char *prog, int flags);
 extern int finish_connect(pid_t pid);
 extern int path_match(const char *path, int nr, char **match);
 extern int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,</diff>
      <filename>cache.h</filename>
    </modified>
    <modified>
      <diff>@@ -394,7 +394,7 @@ static enum protocol get_protocol(const char *name)
 /*
  * Returns a connected socket() fd, or else die()s.
  */
-static int git_tcp_connect_sock(char *host)
+static int git_tcp_connect_sock(char *host, int flags)
 {
 	int sockfd = -1, saved_errno = 0;
 	char *colon, *end;
@@ -425,10 +425,16 @@ static int git_tcp_connect_sock(char *host)
 	hints.ai_socktype = SOCK_STREAM;
 	hints.ai_protocol = IPPROTO_TCP;
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;Looking up %s ... &quot;, host);
+
 	gai = getaddrinfo(host, port, &amp;hints, &amp;ai);
 	if (gai)
 		die(&quot;Unable to look up %s (port %s) (%s)&quot;, host, port, gai_strerror(gai));
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;done.\nConnecting to %s (port %s) ... &quot;, host, port);
+
 	for (ai0 = ai; ai; ai = ai-&gt;ai_next) {
 		sockfd = socket(ai-&gt;ai_family,
 				ai-&gt;ai_socktype, ai-&gt;ai_protocol);
@@ -450,6 +456,9 @@ static int git_tcp_connect_sock(char *host)
 	if (sockfd &lt; 0)
 		die(&quot;unable to connect a socket (%s)&quot;, strerror(saved_errno));
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;done.\n&quot;);
+
 	return sockfd;
 }
 
@@ -458,7 +467,7 @@ static int git_tcp_connect_sock(char *host)
 /*
  * Returns a connected socket() fd, or else die()s.
  */
-static int git_tcp_connect_sock(char *host)
+static int git_tcp_connect_sock(char *host, int flags)
 {
 	int sockfd = -1, saved_errno = 0;
 	char *colon, *end;
@@ -485,6 +494,9 @@ static int git_tcp_connect_sock(char *host)
 		port = colon + 1;
 	}
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;Looking up %s ... &quot;, host);
+
 	he = gethostbyname(host);
 	if (!he)
 		die(&quot;Unable to look up %s (%s)&quot;, host, hstrerror(h_errno));
@@ -497,6 +509,9 @@ static int git_tcp_connect_sock(char *host)
 		nport = se-&gt;s_port;
 	}
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;done.\nConnecting to %s (port %s) ... &quot;, host, port);
+
 	for (ap = he-&gt;h_addr_list; *ap; ap++) {
 		sockfd = socket(he-&gt;h_addrtype, SOCK_STREAM, 0);
 		if (sockfd &lt; 0) {
@@ -521,15 +536,18 @@ static int git_tcp_connect_sock(char *host)
 	if (sockfd &lt; 0)
 		die(&quot;unable to connect a socket (%s)&quot;, strerror(saved_errno));
 
+	if (flags &amp; CONNECT_VERBOSE)
+		fprintf(stderr, &quot;done.\n&quot;);
+
 	return sockfd;
 }
 
 #endif /* NO_IPV6 */
 
 
-static void git_tcp_connect(int fd[2], char *host)
+static void git_tcp_connect(int fd[2], char *host, int flags)
 {
-	int sockfd = git_tcp_connect_sock(host);
+	int sockfd = git_tcp_connect_sock(host, flags);
 
 	fd[0] = sockfd;
 	fd[1] = dup(sockfd);
@@ -646,7 +664,7 @@ static void git_proxy_connect(int fd[2], char *host)
  *
  * Does not return a negative value on error; it just dies.
  */
-pid_t git_connect(int fd[2], char *url, const char *prog)
+pid_t git_connect(int fd[2], char *url, const char *prog, int flags)
 {
 	char *host, *path = url;
 	char *end;
@@ -719,7 +737,7 @@ pid_t git_connect(int fd[2], char *url, const char *prog)
 		if (git_use_proxy(host))
 			git_proxy_connect(fd, host);
 		else
-			git_tcp_connect(fd, host);
+			git_tcp_connect(fd, host, flags);
 		/*
 		 * Separate original protocol components prog and path
 		 * from extended components with a NUL byte.</diff>
      <filename>connect.c</filename>
    </modified>
    <modified>
      <diff>@@ -733,7 +733,7 @@ int main(int argc, char **argv)
 	}
 	if (!dest)
 		usage(fetch_pack_usage);
-	pid = git_connect(fd, dest, uploadpack);
+	pid = git_connect(fd, dest, uploadpack, verbose ? CONNECT_VERBOSE : 0);
 	if (pid &lt; 0)
 		return 1;
 	if (heads &amp;&amp; nr_heads)</diff>
      <filename>fetch-pack.c</filename>
    </modified>
    <modified>
      <diff>@@ -64,7 +64,7 @@ int main(int argc, char **argv)
 	if (!dest || i != argc - 1)
 		usage(peek_remote_usage);
 
-	pid = git_connect(fd, dest, uploadpack);
+	pid = git_connect(fd, dest, uploadpack, 0);
 	if (pid &lt; 0)
 		return 1;
 	ret = peek_remote(fd, flags);</diff>
      <filename>peek-remote.c</filename>
    </modified>
    <modified>
      <diff>@@ -393,7 +393,7 @@ int main(int argc, char **argv)
 		usage(send_pack_usage);
 	verify_remote_names(nr_heads, heads);
 
-	pid = git_connect(fd, dest, receivepack);
+	pid = git_connect(fd, dest, receivepack, verbose ? CONNECT_VERBOSE : 0);
 	if (pid &lt; 0)
 		return 1;
 	ret = send_pack(fd[0], fd[1], nr_heads, heads);</diff>
      <filename>send-pack.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>fdcb769916c93b53517ef1b4cae447a3333c9b86</id>
    </parent>
  </parents>
  <author>
    <name>Michael S. Tsirkin</name>
    <email>mst@dev.mellanox.co.il</email>
  </author>
  <url>http://github.com/schacon/git-source/commit/7841ce79854868eaaa146c1d018b17fc4f3320be</url>
  <id>7841ce79854868eaaa146c1d018b17fc4f3320be</id>
  <committed-date>2007-05-16T12:48:18-07:00</committed-date>
  <authored-date>2007-05-16T10:09:41-07:00</authored-date>
  <message>connect: display connection progress

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 firewall problems.

Signed-off-by: Michael S. Tsirkin &lt;mst@dev.mellanox.co.il&gt;
Acked-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;</message>
  <tree>297639aba698d4c6a1c1b573ea96aa741c6bc9c3</tree>
  <committer>
    <name>Junio C Hamano</name>
    <email>junkio@cox.net</email>
  </committer>
</commit>
