summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1207032)
raw | patch | inline | side by side (parent: 1207032)
author | Jeff King <peff@peff.net> | |
Wed, 5 Aug 2009 20:23:26 +0000 (16:23 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Aug 2009 03:14:11 +0000 (20:14 -0700) |
When --quiet is given, the user generally only wants to see
errors. So let's suppress printing the ref status table
unless there is an error, in which case we print out the
whole table.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
errors. So let's suppress printing the ref status table
unless there is an error, in which case we print out the
whole table.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport.c | patch | blob | history |
diff --git a/transport.c b/transport.c
index c3191ed20125b7b40f973d23d610adedb27e9209..a3d01451165731e1de5f6b3ecb60e9ce99ba9561 100644 (file)
--- a/transport.c
+++ b/transport.c
return (refs ? 0 : -1);
}
+static int push_had_errors(struct ref *ref)
+{
+ for (; ref; ref = ref->next) {
+ switch (ref->status) {
+ case REF_STATUS_NONE:
+ case REF_STATUS_UPTODATE:
+ case REF_STATUS_OK:
+ break;
+ default:
+ return 1;
+ }
+ }
+ return 0;
+}
+
static int refs_pushed(struct ref *ref)
{
for (; ref; ref = ref->next) {
struct ref *local_refs = get_local_heads();
int match_flags = MATCH_REFS_NONE;
int verbose = flags & TRANSPORT_PUSH_VERBOSE;
+ int quiet = flags & TRANSPORT_PUSH_QUIET;
int porcelain = flags & TRANSPORT_PUSH_PORCELAIN;
int ret;
ret = transport->push_refs(transport, remote_refs, flags);
- print_push_status(transport->url, remote_refs, verbose | porcelain, porcelain);
+ if (!quiet || push_had_errors(remote_refs))
+ print_push_status(transport->url, remote_refs,
+ verbose | porcelain, porcelain);
if (!(flags & TRANSPORT_PUSH_DRY_RUN)) {
struct ref *ref;