Skip to content

Commit

Permalink
Merge branch 'ew/connect-verbose'
Browse files Browse the repository at this point in the history
There were a few "now I am doing this thing" progress messages in
the TCP connection code that can be triggered by setting a verbose
option internally in the code, but "git fetch -v" and friends never
passed the verbose option down to that codepath.

There was a brief discussion about the impact on the end-user
experience by not limiting this to "fetch -v -v", but I think the
conclusion is that this is OK to enable with a single "-v" as it is
not too noisy.

* ew/connect-verbose:
  pass transport verbosity down to git_connect
  • Loading branch information
Junio C Hamano committed Feb 10, 2016
2 parents 0e35fcb + f3ee9ca commit fbf4bdf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,18 @@ 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;

data->conn = git_connect(data->fd, transport->url,
for_push ? data->options.receivepack :
data->options.uploadpack,
verbose ? CONNECT_VERBOSE : 0);
flags);

return 0;
}
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fbf4bdf

Please sign in to comment.