Skip to content

Commit

Permalink
push: teach push to pass --verbose option to transport layer
Browse files Browse the repository at this point in the history
A --verbose option to push should also be passed to the
transport layer, i.e. git-send-pack, git-http-push.

git push is modified to do so.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Steffen Prohaska authored and Junio C Hamano committed Nov 11, 2007
1 parent 05ee917 commit 1b2486d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions builtin-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ int cmd_push(int argc, const char **argv, const char *prefix)
flags |= TRANSPORT_PUSH_FORCE;
if (dry_run)
flags |= TRANSPORT_PUSH_DRY_RUN;
if (verbose)
flags |= TRANSPORT_PUSH_VERBOSE;
if (tags)
add_refspec("refs/tags/*");
if (all)
Expand Down
8 changes: 6 additions & 2 deletions transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int curl_transport_push(struct transport *transport, int refspec_nr, cons
int argc;
int err;

argv = xmalloc((refspec_nr + 11) * sizeof(char *));
argv = xmalloc((refspec_nr + 12) * sizeof(char *));
argv[0] = "http-push";
argc = 1;
if (flags & TRANSPORT_PUSH_ALL)
Expand All @@ -395,6 +395,8 @@ static int curl_transport_push(struct transport *transport, int refspec_nr, cons
argv[argc++] = "--force";
if (flags & TRANSPORT_PUSH_DRY_RUN)
argv[argc++] = "--dry-run";
if (flags & TRANSPORT_PUSH_VERBOSE)
argv[argc++] = "--verbose";
argv[argc++] = transport->url;
while (refspec_nr--)
argv[argc++] = *refspec++;
Expand Down Expand Up @@ -655,7 +657,7 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
int argc;
int err;

argv = xmalloc((refspec_nr + 11) * sizeof(char *));
argv = xmalloc((refspec_nr + 12) * sizeof(char *));
argv[0] = "send-pack";
argc = 1;
if (flags & TRANSPORT_PUSH_ALL)
Expand All @@ -664,6 +666,8 @@ static int git_transport_push(struct transport *transport, int refspec_nr, const
argv[argc++] = "--force";
if (flags & TRANSPORT_PUSH_DRY_RUN)
argv[argc++] = "--dry-run";
if (flags & TRANSPORT_PUSH_VERBOSE)
argv[argc++] = "--verbose";
if (data->receivepack) {
char *rp = xmalloc(strlen(data->receivepack) + 16);
sprintf(rp, "--receive-pack=%s", data->receivepack);
Expand Down
1 change: 1 addition & 0 deletions transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct transport {
#define TRANSPORT_PUSH_ALL 1
#define TRANSPORT_PUSH_FORCE 2
#define TRANSPORT_PUSH_DRY_RUN 4
#define TRANSPORT_PUSH_VERBOSE 8

/* Returns a transport suitable for the url */
struct transport *transport_get(struct remote *, const char *);
Expand Down

0 comments on commit 1b2486d

Please sign in to comment.