summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Nicolas Pitre <nico@cam.org>2006-10-31 16:58:32 -0500
committerLibravatar Junio C Hamano <junkio@cox.net>2006-11-01 15:13:10 -0800
commitfa438a2eb116c71eaebecdc104a1af01ea83b9fa (patch)
treeb26a74d76fe851154bfc9a3ecbce92b3b0cc4227
parentMerge branch 'maint' (diff)
downloadtgif-fa438a2eb116c71eaebecdc104a1af01ea83b9fa.tar.xz
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>
-rw-r--r--Documentation/git-pack-objects.txt2
-rw-r--r--builtin-pack-objects.c18
-rw-r--r--send-pack.c1
3 files changed, 13 insertions, 8 deletions
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index 9bd1e39feb..5ebe34eebf 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -10,7 +10,7 @@ SYNOPSIS
--------
[verse]
'git-pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]
- [--local] [--incremental] [--window=N] [--depth=N]
+ [--local] [--incremental] [--window=N] [--depth=N] [--all-progress]
[--revs [--unpacked | --all]*] [--stdout | base-name] < object-list
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 41e1e74533..270bcbded6 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -15,7 +15,7 @@
#include <sys/time.h>
#include <signal.h>
-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]";
+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]";
struct object_entry {
unsigned char sha1[20];
@@ -475,15 +475,15 @@ static void write_pack_file(void)
unsigned long offset;
struct pack_header hdr;
unsigned last_percent = 999;
- int do_progress = 0;
+ int do_progress = progress;
- if (!base_name)
+ if (!base_name) {
f = sha1fd(1, "<stdout>");
- else {
+ do_progress >>= 1;
+ }
+ else
f = sha1create("%s-%s.%s", base_name,
sha1_to_hex(object_list_sha1), "pack");
- do_progress = progress;
- }
if (do_progress)
fprintf(stderr, "Writing %d objects.\n", nr_result);
@@ -1524,6 +1524,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
progress = 1;
continue;
}
+ if (!strcmp("--all-progress", arg)) {
+ progress = 2;
+ continue;
+ }
if (!strcmp("--incremental", arg)) {
incremental = 1;
continue;
@@ -1641,7 +1645,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
else {
if (nr_result)
prepare_pack(window, depth);
- if (progress && pack_to_stdout) {
+ if (progress == 1 && pack_to_stdout) {
/* the other end usually displays progress itself */
struct itimerval v = {{0,},};
setitimer(ITIMER_REAL, &v, NULL);
diff --git a/send-pack.c b/send-pack.c
index fbd792ccf4..447666665b 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -29,6 +29,7 @@ static void exec_pack_objects(void)
{
static const char *args[] = {
"pack-objects",
+ "--all-progress",
"--stdout",
NULL
};