git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steffen Prohaska <prohaska@zib.de>
To: git@vger.kernel.org
Cc: Steffen Prohaska <gitster@pobox.com>, Steffen Prohaska <prohaska@zib.de>
Subject: [PATCH 2/6] push: teach push to pass --verbose option to transport layer
Date: Sun, 11 Nov 2007 15:01:44 +0100	[thread overview]
Message-ID: <11947897081278-git-send-email-prohaska@zib.de> (raw)
In-Reply-To: <11947897083381-git-send-email-prohaska@zib.de>

From: Steffen Prohaska <gitster@pobox.com>

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>
---
 builtin-push.c |    2 ++
 transport.c    |    8 ++++++--
 transport.h    |    1 +
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/builtin-push.c b/builtin-push.c
index 2c56195..6d1da07 100644
--- a/builtin-push.c
+++ b/builtin-push.c
@@ -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)
diff --git a/transport.c b/transport.c
index fa5cfbb..e8a2608 100644
--- a/transport.c
+++ b/transport.c
@@ -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)
@@ -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++;
@@ -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)
@@ -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);
diff --git a/transport.h b/transport.h
index df12ea7..2f80ab4 100644
--- a/transport.h
+++ b/transport.h
@@ -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 *);
-- 
1.5.3.5.578.g886d

  reply	other threads:[~2007-11-11 14:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-11 14:01 [REPLACEMENT PATCH 0/6] improve refspec handling in push, refactor matching in fetch Steffen Prohaska
2007-11-11 14:01 ` [PATCH 1/6] push: mention --verbose option in documentation Steffen Prohaska
2007-11-11 14:01   ` Steffen Prohaska [this message]
2007-11-11 14:01     ` [PATCH 3/6] push: support pushing HEAD to real branch name Steffen Prohaska
2007-11-11 14:01       ` [PATCH 4/6] add ref_abbrev_matches_full_with_rules() Steffen Prohaska
2007-11-11 14:01         ` [PATCH 5/6] push: use same rules as git-rev-parse to resolve refspecs Steffen Prohaska
2007-11-11 14:01           ` [PATCH 6/6] refactor fetch's ref matching to use ref_abbrev_matches_full_with_rules() Steffen Prohaska
2007-11-11 14:55             ` Jakub Narebski
2007-11-11 17:31               ` Steffen Prohaska
2007-11-12 19:51           ` [PATCH 5/6] push: use same rules as git-rev-parse to resolve refspecs Junio C Hamano
2007-11-12 20:48             ` Steffen Prohaska
2007-11-12 19:51         ` [PATCH 4/6] add ref_abbrev_matches_full_with_rules() Junio C Hamano
2007-11-12 20:51           ` Steffen Prohaska
2007-11-11 14:17       ` [PATCH 3/6] push: support pushing HEAD to real branch name Andreas Ericsson
2007-11-11 14:35         ` [REPLACEMENT PATCH " Steffen Prohaska
2007-11-11 14:10   ` [PATCH 1/6] push: mention --verbose option in documentation Steffen Prohaska
2007-11-11 14:14     ` Steffen Prohaska
2007-11-11 19:39       ` Junio C Hamano

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=11947897081278-git-send-email-prohaska@zib.de \
    --to=prohaska@zib.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).