summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2012-02-13 21:17:15 +0100
committerJunio C Hamano <gitster@pobox.com>2012-02-13 13:06:53 -0800
commit01fdc21f6e90f56fc5a49cbba751d9ead19b2f03 (patch)
tree7a8503c31417735d5765ddd1c2a63749e254d513 /transport.c
parent58d4203aa617293d1dc3746a1ea33d84eb766e0f (diff)
downloadgit-01fdc21f6e90f56fc5a49cbba751d9ead19b2f03.tar.gz
push/fetch/clone --no-progress suppresses progress outputcb/transfer-no-progress
By default, progress output is disabled if stderr is not a terminal. The --progress option can be used to force progress output anyways. Conversely, --no-progress does not force progress output. In particular, if stderr is a terminal, progress output is enabled. This is unintuitive. Change --no-progress to force output off. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/transport.c b/transport.c
index cac0c065ff..401b8dd35c 100644
--- a/transport.c
+++ b/transport.c
@@ -993,11 +993,15 @@ void transport_set_verbosity(struct transport *transport, int verbosity,
* Rules used to determine whether to report progress (processing aborts
* when a rule is satisfied):
*
- * 1. Report progress, if force_progress is 1 (ie. --progress).
- * 2. Don't report progress, if verbosity < 0 (ie. -q/--quiet ).
- * 3. Report progress if isatty(2) is 1.
+ * . Report progress, if force_progress is 1 (ie. --progress).
+ * . Don't report progress, if force_progress is 0 (ie. --no-progress).
+ * . Don't report progress, if verbosity < 0 (ie. -q/--quiet ).
+ * . Report progress if isatty(2) is 1.
**/
- transport->progress = force_progress || (verbosity >= 0 && isatty(2));
+ if (force_progress >= 0)
+ transport->progress = !!force_progress;
+ else
+ transport->progress = verbosity >= 0 && isatty(2);
}
int transport_push(struct transport *transport,