summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 23abd3f)
raw | patch | inline | side by side (parent: 23abd3f)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Wed, 8 Oct 2008 23:40:32 +0000 (01:40 +0200) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 9 Oct 2008 18:26:17 +0000 (11:26 -0700) |
The new -v option forces the progressbar, even in case the output
is not a terminal. This can be useful if the caller is an IDE or
wrapper which wants to scrape the progressbar from stderr and show
its information in a different format.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
is not a terminal. This can be useful if the caller is an IDE or
wrapper which wants to scrape the progressbar from stderr and show
its information in a different format.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
index 0e14e732fd470b7f48882c9959235785df19b7b0..95f08b911464b348525e4c65cca32946c583e762 100644 (file)
Operate quietly. This flag is also passed to the `rsync'
command when given.
+--verbose::
+-v::
+ Display the progressbar, even in case the standard output is not
+ a terminal.
+
--no-checkout::
-n::
No checkout of HEAD is performed after the clone is complete.
diff --git a/builtin-clone.c b/builtin-clone.c
index 49d2eb9c2ba574f2c1484717f0755208e7ed8147..df71b2381066fa1747bb4afa64e7e7560547ef22 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
static char *option_template, *option_reference, *option_depth;
static char *option_origin = NULL;
static char *option_upload_pack = "git-upload-pack";
+static int option_verbose;
static struct option builtin_clone_options[] = {
OPT__QUIET(&option_quiet),
+ OPT__VERBOSE(&option_verbose),
OPT_BOOLEAN('n', "no-checkout", &option_no_checkout,
"don't create a checkout"),
OPT_BOOLEAN(0, "bare", &option_bare, "create a bare repository"),
if (option_quiet)
transport->verbose = -1;
+ else if (option_verbose)
+ transport->progress = 1;
if (option_upload_pack)
transport_set_option(transport, TRANS_OPT_UPLOADPACK,
index 328e4d9a339101d04bb22e441a8955f6c2e1f260..27825f5f31ca2310e08fd2555589aa878728b292 100755 (executable)
--- a/t/t5702-clone-options.sh
+++ b/t/t5702-clone-options.sh
'
+test_expect_success 'redirected clone' '
+
+ git clone "file://$(pwd)/parent" clone-redirected >out 2>err &&
+ test ! -s err
+
+'
+test_expect_success 'redirected clone -v' '
+
+ git clone -v "file://$(pwd)/parent" clone-redirected-v >out 2>err &&
+ test -s err
+
+'
+
test_done
diff --git a/transport.c b/transport.c
index 5110c56c4e80dc224ff3308e643fad6d5ed77ffb..1c510a3360e26bc7cf622036574fe9d06c1aa6da 100644 (file)
--- a/transport.c
+++ b/transport.c
args.include_tag = data->followtags;
args.verbose = (transport->verbose > 0);
args.quiet = (transport->verbose < 0);
- args.no_progress = args.quiet || !isatty(1);
+ args.no_progress = args.quiet || (!transport->progress && !isatty(1));
args.depth = data->depth;
for (i = 0; i < nr_heads; i++)
diff --git a/transport.h b/transport.h
index d0b52053fff9bc463438674232bffb6024f3b1fc..6bbc1a82642ab9e5722cfe6ab34ec4246b3a9dd4 100644 (file)
--- a/transport.h
+++ b/transport.h
int (*disconnect)(struct transport *connection);
char *pack_lockfile;
signed verbose : 2;
+ /* Force progress even if the output is not a tty */
+ unsigned progress : 1;
};
#define TRANSPORT_PUSH_ALL 1