|
15 | 15 | #include <sys/time.h> |
16 | 16 | #include <signal.h> |
17 | 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 | 19 |
|
20 | 20 | struct object_entry { |
21 | 21 | unsigned char sha1[20]; |
@@ -475,15 +475,15 @@ static void write_pack_file(void) |
475 | 475 | unsigned long offset; |
476 | 476 | struct pack_header hdr; |
477 | 477 | unsigned last_percent = 999; |
478 | | - int do_progress = 0; |
| 478 | + int do_progress = progress; |
479 | 479 |
|
480 | | - if (!base_name) |
| 480 | + if (!base_name) { |
481 | 481 | f = sha1fd(1, "<stdout>"); |
482 | | - else { |
| 482 | + do_progress >>= 1; |
| 483 | + } |
| 484 | + else |
483 | 485 | f = sha1create("%s-%s.%s", base_name, |
484 | 486 | sha1_to_hex(object_list_sha1), "pack"); |
485 | | - do_progress = progress; |
486 | | - } |
487 | 487 | if (do_progress) |
488 | 488 | fprintf(stderr, "Writing %d objects.\n", nr_result); |
489 | 489 |
|
@@ -1524,6 +1524,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) |
1524 | 1524 | progress = 1; |
1525 | 1525 | continue; |
1526 | 1526 | } |
| 1527 | + if (!strcmp("--all-progress", arg)) { |
| 1528 | + progress = 2; |
| 1529 | + continue; |
| 1530 | + } |
1527 | 1531 | if (!strcmp("--incremental", arg)) { |
1528 | 1532 | incremental = 1; |
1529 | 1533 | continue; |
@@ -1641,7 +1645,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix) |
1641 | 1645 | else { |
1642 | 1646 | if (nr_result) |
1643 | 1647 | prepare_pack(window, depth); |
1644 | | - if (progress && pack_to_stdout) { |
| 1648 | + if (progress == 1 && pack_to_stdout) { |
1645 | 1649 | /* the other end usually displays progress itself */ |
1646 | 1650 | struct itimerval v = {{0,},}; |
1647 | 1651 | setitimer(ITIMER_REAL, &v, NULL); |
|
0 commit comments