make git-push a bit more verbose
Currently git-push displays progress status for the local packing of objects to send, but nothing once it starts to push it over the connection. Having progress status in that later case is especially nice when pushing lots of objects over a slow network link. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre committed
Oct 31, 2006 at 16:58 UTC
fa438a2eb116c71eaebecdc104a1af01ea83b9fa
3 files changed
+13
-8
Documentation/git-pack-objects.txt
+1
-1
@@ -10,7 +10,7 @@ SYNOPSIS
10
--------
11
[verse]
12
'git-pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
13
- [--local] [--incremental] [--window=N] [--depth=N]
13
+ [--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
14
[--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
15
16
builtin-pack-objects.c
+11
-7
@@ -15,7 +15,7 @@
15
#include <sys/time.h>
16
#include <signal.h>
17
18
-static const char pack_usage[] = "git-pack-objects [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] [--revs [--unpacked | --all]*] [--stdout | base-name] <ref-list | <object-list]";
18
+static const char pack_usage[] = "git-pack-objects [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] [--all-progress] [--revs [--unpacked | --all]*] [--stdout | base-name] <ref-list | <object-list]";
19
20
struct object_entry {
21
unsigned char sha1[20];
@@ -475,15 +475,15 @@ static void write_pack_file(void)
475
unsigned long offset;
476
struct pack_header hdr;
477
unsigned last_percent = 999;
478
- int do_progress = 0;
478
+ int do_progress = progress;
479
480
- if (!base_name)
480
+ if (!base_name) {
481
f = sha1fd(1, "<stdout>");
482
- else {
482
+ do_progress >>= 1;
483
+ }
484
+ else
485
f = sha1create("%s-%s.%s", base_name,
486
sha1_to_hex(object_list_sha1), "pack");
485
- do_progress = progress;
486
- }
487
if (do_progress)
488
fprintf(stderr, "Writing %d objects.\n", nr_result);
489
@@ -1524,6 +1524,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
1524
progress = 1;
1525
continue;
1526
}
1527
+ if (!strcmp("--all-progress", arg)) {
1528
+ progress = 2;
1529
+ continue;
1530
+ }
1531
if (!strcmp("--incremental", arg)) {
1532
incremental = 1;
1533
continue;
@@ -1641,7 +1645,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
1645
else {
1646
if (nr_result)
1647
prepare_pack(window, depth);
1644
- if (progress && pack_to_stdout) {
1648
+ if (progress == 1 && pack_to_stdout) {
1649
/* the other end usually displays progress itself */
1650
struct itimerval v = {{0,},};
1651
setitimer(ITIMER_REAL, &v, NULL);
send-pack.c
+1
@@ -29,6 +29,7 @@ static void exec_pack_objects(void)
29
{
30
static const char *args[] = {
31
"pack-objects",
32
+ "--all-progress",
33
"--stdout",
34
NULL
35
};