[PATCH] make git-push a bit more verbose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>

---

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 41e1e74..5f56a95 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -475,11 +475,12 @@ static void write_pack_file(void)
 	unsigned long offset;
 	struct pack_header hdr;
 	unsigned last_percent = 999;
-	int do_progress = 0;
+	int do_progress;
 
-	if (!base_name)
+	if (!base_name) {
 		f = sha1fd(1, "<stdout>");
-	else {
+		do_progress = progress >> 1;
+	} else {
 		f = sha1create("%s-%s.%s", base_name,
 			       sha1_to_hex(object_list_sha1), "pack");
 		do_progress = progress;
@@ -1524,6 +1525,10 @@ int cmd_pack_objects(int argc, const cha
 			progress = 1;
 			continue;
 		}
+		if (!strcmp("--all-progress", arg)) {
+			progress = 2;
+			continue;
+		}
 		if (!strcmp("--incremental", arg)) {
 			incremental = 1;
 			continue;
@@ -1641,7 +1646,7 @@ int cmd_pack_objects(int argc, const cha
 	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 fbd792c..4476666 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
 	};
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]