Make pack-objects chattier.
You could give -q to squelch it, but currently no tool does it. This would make 'git clone host:repo here' over ssh not silent again. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Feb 12, 2006 at 13:01 UTC
024701f1d88d79f3777bf45c82437f40a80b6eaa
1 file changed
+6
-4
pack-objects.c
+6
-4
@@ -5,7 +5,7 @@
5
#include "csum-file.h"
6
#include <sys/time.h>
7
8
-static const char pack_usage[] = "git-pack-objects [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] {--stdout | base-name} < object-list";
8
+static const char pack_usage[] = "git-pack-objects [-q] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] {--stdout | base-name} < object-list";
9
10
struct object_entry {
11
unsigned char sha1[20];
@@ -27,7 +27,7 @@ static struct object_entry *objects = NULL;
27
static int nr_objects = 0, nr_alloc = 0;
28
static const char *base_name;
29
static unsigned char pack_file_sha1[20];
30
-static int progress = 0;
30
+static int progress = 1;
31
32
static void *delta_against(void *buf, unsigned long size, struct object_entry *entry)
33
{
@@ -520,6 +520,10 @@ int main(int argc, char **argv)
520
usage(pack_usage);
521
continue;
522
}
523
+ if (!strcmp("-q", arg)) {
524
+ progress = 0;
525
+ continue;
526
+ }
527
if (!strcmp("--stdout", arg)) {
528
pack_to_stdout = 1;
529
continue;
@@ -534,8 +538,6 @@ int main(int argc, char **argv)
538
if (pack_to_stdout != !base_name)
539
usage(pack_usage);
540
537
- progress = isatty(2);
538
-
541
prepare_packed_git();
542
if (progress) {
543
fprintf(stderr, "Generating pack...\n");