All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] pass transport verbosity down to git_connect
Date: Thu, 28 Jan 2016 15:45:50 -0800	[thread overview]
Message-ID: <xmqqegd1l13l.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160128225123.GA20045@dcvr.yhbt.net> (Eric Wong's message of "Thu, 28 Jan 2016 22:51:23 +0000")

Eric Wong <normalperson@yhbt.net> writes:

> While working in connect.c to perform non-blocking connections,
> I noticed calling "git fetch -v" was not causing the progress
> messages inside git_tcp_connect_sock to be emitted as I
> expected.

Nice.  Can we demonstrate and protect this fix with simple tests?

Thanks.  Will queue.

>  transport.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/transport.c b/transport.c
> index 67f3666..9ae7184 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -481,9 +481,10 @@ static int set_git_option(struct git_transport_options *opts,
>  	return 1;
>  }
>  
> -static int connect_setup(struct transport *transport, int for_push, int verbose)
> +static int connect_setup(struct transport *transport, int for_push)
>  {
>  	struct git_transport_data *data = transport->data;
> +	int flags = transport->verbose > 0 ? CONNECT_VERBOSE : 0;
>  
>  	if (data->conn)
>  		return 0;
> @@ -491,7 +492,7 @@ static int connect_setup(struct transport *transport, int for_push, int verbose)
>  	data->conn = git_connect(data->fd, transport->url,
>  				 for_push ? data->options.receivepack :
>  				 data->options.uploadpack,
> -				 verbose ? CONNECT_VERBOSE : 0);
> +				 flags);
>  
>  	return 0;
>  }
> @@ -501,7 +502,7 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pus
>  	struct git_transport_data *data = transport->data;
>  	struct ref *refs;
>  
> -	connect_setup(transport, for_push, 0);
> +	connect_setup(transport, for_push);
>  	get_remote_heads(data->fd[0], NULL, 0, &refs,
>  			 for_push ? REF_NORMAL : 0,
>  			 &data->extra_have,
> @@ -536,7 +537,7 @@ static int fetch_refs_via_pack(struct transport *transport,
>  	args.update_shallow = data->options.update_shallow;
>  
>  	if (!data->got_remote_heads) {
> -		connect_setup(transport, 0, 0);
> +		connect_setup(transport, 0);
>  		get_remote_heads(data->fd[0], NULL, 0, &refs_tmp, 0,
>  				 NULL, &data->shallow);
>  		data->got_remote_heads = 1;
> @@ -812,7 +813,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
>  
>  	if (!data->got_remote_heads) {
>  		struct ref *tmp_refs;
> -		connect_setup(transport, 1, 0);
> +		connect_setup(transport, 1);
>  
>  		get_remote_heads(data->fd[0], NULL, 0, &tmp_refs, REF_NORMAL,
>  				 NULL, &data->shallow);

  reply	other threads:[~2016-01-28 23:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-28 22:51 [PATCH] pass transport verbosity down to git_connect Eric Wong
2016-01-28 23:45 ` Junio C Hamano [this message]
2016-01-30  8:50   ` [PATCH v2] " Eric Wong
2016-01-30 13:13     ` [PATCH 2/1] support -4 and -6 switches for remote operations Eric Wong
2016-01-30 13:28       ` Eric Wong
2016-01-30 23:34       ` Torsten Bögershausen
2016-01-31  0:01         ` Eric Wong
2016-01-31  1:13           ` Jeff King
2016-02-03  4:09             ` [PATCH v2 " Eric Wong
2016-02-12 11:31               ` Eric Wong
2016-02-12 15:43                 ` Torsten Bögershausen
2016-01-31 16:03           ` [PATCH " Torsten Bögershausen
2016-01-28 23:53 ` [PATCH] pass transport verbosity down to git_connect Jeff King
2016-01-29  0:38   ` Eric Wong
2016-01-29  3:19     ` Junio C Hamano
2016-01-29  3:47       ` Jeff King
2016-01-29 17:34         ` Junio C Hamano
2016-01-29 17:41           ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqegd1l13l.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.