Skip to content
This repository was archived by the owner on Jul 2, 2019. It is now read-only.

Commit fa438a2

Browse files
Nicolas PitreJunio C Hamano
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7854e52 commit fa438a2

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Documentation/git-pack-objects.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SYNOPSIS
1010
--------
1111
[verse]
1212
'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]
1414
[--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
1515

1616

builtin-pack-objects.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <sys/time.h>
1616
#include <signal.h>
1717

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]";
1919

2020
struct object_entry {
2121
unsigned char sha1[20];
@@ -475,15 +475,15 @@ static void write_pack_file(void)
475475
unsigned long offset;
476476
struct pack_header hdr;
477477
unsigned last_percent = 999;
478-
int do_progress = 0;
478+
int do_progress = progress;
479479

480-
if (!base_name)
480+
if (!base_name) {
481481
f = sha1fd(1, "<stdout>");
482-
else {
482+
do_progress >>= 1;
483+
}
484+
else
483485
f = sha1create("%s-%s.%s", base_name,
484486
sha1_to_hex(object_list_sha1), "pack");
485-
do_progress = progress;
486-
}
487487
if (do_progress)
488488
fprintf(stderr, "Writing %d objects.\n", nr_result);
489489

@@ -1524,6 +1524,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
15241524
progress = 1;
15251525
continue;
15261526
}
1527+
if (!strcmp("--all-progress", arg)) {
1528+
progress = 2;
1529+
continue;
1530+
}
15271531
if (!strcmp("--incremental", arg)) {
15281532
incremental = 1;
15291533
continue;
@@ -1641,7 +1645,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
16411645
else {
16421646
if (nr_result)
16431647
prepare_pack(window, depth);
1644-
if (progress && pack_to_stdout) {
1648+
if (progress == 1 && pack_to_stdout) {
16451649
/* the other end usually displays progress itself */
16461650
struct itimerval v = {{0,},};
16471651
setitimer(ITIMER_REAL, &v, NULL);

send-pack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ static void exec_pack_objects(void)
2929
{
3030
static const char *args[] = {
3131
"pack-objects",
32+
"--all-progress",
3233
"--stdout",
3334
NULL
3435
};

0 commit comments

Comments
 (0)