Skip to contentSkip to conversation

removal of "percent done" messages from git pull

DISCUSSION Larry Streepy 5 participants 8 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

+ git pull
remote: Generating pack...
remote: Done counting 204 objects.
Result has 107 objects.
Deltifying 107 objects.
0% (1/107) done 1% (2/107) done 2% (3/107) dremote: one 3%
(4/107) done 4% (5/107) done 5% (6/107) done 6% (7/107) done 7% (8/107) done 8% (9/107) done 9% (10/remote: 107) done 10% (11/107) done 11% (12/107) done 12% (13/107) done 13% (14/107) done 14% (15/107) done 15% (17/107) donremote: e 16% (18/107) done 17% (19/107) done 18% (20/107) done 19% (21/107) done 20% (22/107) done 21% (23/107) done 22% remote: (24/107) done 23% (25/107) done 24% (26/107) done 25% (27/107) done 26% (28/107) done 27% (29/107) done 28% (30/107)remote: done 29% (32/107) done 30% (33/107) done 31% (34/107) done 32% (35/107) done 33% (36/107) done 34% (37/107) done remote: 35% (38/107) done 36% (39/107) done 37% (40/107) done 38% (41/107) done 39% (42/107) doneremote: 40% (43/107) doneremote: 41% (44/107) doneremote: 42% (45/107) doneremote:
43% (47/107) doneremote: 44% (48/107) doneremote: !
45% (49/107) doneremote: 46% (50/107) doneremote: 47% (51/107)
doneremote: 48% (52/107) doneremote: 49% (53/107) doneremote: 50% (54/107) doneremote: 51% (55/107) doneremote: 52% (56/107) doneremote:
53% (57/107) doneremote: 54% (58/107) doneremote: 55% (59/107)
doneremote: 56% (60/107) doneremote: 57% (61/107) doneremote: 58% (63/107) doneremote: 59% (64/107) doneremote: 60% (65/107) doneremote:
61% (66/107) doneremote: 62% (67/107) done 63% (68/107) doneremote:
64% (69/107) doneremote: 65% (70/107) doneremote: 66% (71/107)
doneremote: 67% (72/107) done 68% (73/107) done 69% (74/107) done 70% (75/107) done 71% (76/107) doneremote: 72% (78/107) done 73% (79/107) done 74% (80/107) done 75% (81/107) done 76% (82/107) done 77% (83/107) done 78% (8remote: 4/107) done 79% (85/107) done 80% (86/107) done 81% (87/107) done 82% (88/107) done 83% (89/107) done 84% (90/107) dremote: on!
e 85% (91/107) done 86% (93/107) done 87% (94/107) done!
88% (9
5/107) done 89% (96/107) done 90% (97/107) done 91remote: % (98/107) done 92% (99/107) done 93% (100/107) done 94% (101/107) done 95% (102/107) done 96% (103/107) done 97% (1remote: 04/107) done 98% (105/107) done 99% (106/107) done 100% (107/107) done Unpacking 107 objects
remote: Total 107, written 107 (delta 70), reused 78 (delta 41)

I have found no way to make these messages go away. When running in a "batch" mode, IMHO, interactive messages like these should not be emitted.
At least there should be a switch to suppress them.

Have I missed the magic switch that will accomplish this?

Larry.

P.S. I'm using 1.4.4.1

#1 lore raw
Quoted 49 lines · Larry Streepy

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

+ git pull
remote: Generating pack...
remote: Done counting 204 objects.
Result has 107 objects.
Deltifying 107 objects.

    0% (1/107) done   1% (2/107) done   2% (3/107) dremote: one   3% 
(4/107) done   4% (5/107) done   5% (6/107) done   6% (7/107) done   7% 
(8/107) done   8% (9/107) done   9% (10/remote: 107) done  10% (11/107) 

done 11% (12/107) done 12% (13/107) done 13% (14/107) done 14% (15/107) done 15% (17/107) donremote: e 16% (18/107) done 17% (19/107) done 18% (20/107) done 19% (21/107) done 20% (22/107) done 21% (23/107) done 22%
remote: (24/107) done 23% (25/107) done 24% (26/107) done 25% (27/107) done 26% (28/107) done 27% (29/107) done 28% (30/107)remote: done 29%

(32/107) done  30% (33/107) done  31% (34/107) done  32% (35/107) done  33% 
(36/107) done  34% (37/107) done  remote: 35% (38/107) done  36% (39/107) 
done  37% (40/107) done  38% (41/107) done  39% (42/107) doneremote:   40% 
(43/107) doneremote:   41% (44/107) doneremote:   42% (45/107) doneremote: 
   43% (47/107) doneremote:   44% (48/107) doneremote:   !
  45% (49/107) doneremote:   46% (50/107) doneremote:   47% (51/107) 
doneremote:   48% (52/107) doneremote:   49% (53/107) doneremote:   50% 
(54/107) doneremote:   51% (55/107) doneremote:   52% (56/107) doneremote: 
   53% (57/107) doneremote:   54% (58/107) doneremote:   55% (59/107) 
doneremote:   56% (60/107) doneremote:   57% (61/107) doneremote:   58% 
(63/107) doneremote:   59% (64/107) doneremote:   60% (65/107) doneremote: 
   61% (66/107) doneremote:   62% (67/107) done  63% (68/107) doneremote: 

64% (69/107) doneremote: 65% (70/107) doneremote: 66% (71/107)
doneremote: 67% (72/107) done 68% (73/107) done 69% (74/107) done 70%
(75/107) done 71% (76/107) doneremote: 72% (78/107) done 73% (79/107)
done 74% (80/107) done 75% (81/107) done 76% (82/107) done 77% (83/107) done 78% (8remote: 4/107) done 79% (85/107) done 80% (86/107) done 81% (87/107) done 82% (88/107) done 83% (89/107) done 84% (90/107) dremote: on!
e 85% (91/107) done 86% (93/107) done 87% (94/107) done!

    88% (9

5/107) done 89% (96/107) done 90% (97/107) done 91remote: % (98/107) done 92% (99/107) done 93% (100/107) done 94% (101/107) done 95% (102/107) done 96% (103/107) done 97% (1remote: 04/107) done 98% (105/107) done 99% (106/107) done 100% (107/107) done Unpacking 107 objects
remote: Total 107, written 107 (delta 70), reused 78 (delta 41)

I have found no way to make these messages go away. When running in a "batch" mode, IMHO, interactive messages like these should not be emitted.
At least there should be a switch to suppress them.

Quoted 5 lines

Have I missed the magic switch that will accomplish this?

Larry.

P.S. I'm using 1.4.4.1

Have you tried with -q to make it more silent? (I didn't try this, but normaly the git porcelain commands just pass the options they don't understand to the underlying core commands; and git-fetch-pack has the option -q for quiet)

-Peter

#2 lore raw

Hi Peter,

Yes, I did try that, but the underlying "git-fetch" command complains about improper usage. So it seems that git-fetch-pack is not being called (or it is called from git-fetch and git-fetch is failing to understand -q).

Thanks,
Larry.

Quoted 10 lines · Peter Baumann
Quoted 2 lines · Larry Streepy

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

Have you tried with -q to make it more silent? (I didn't try this, but normaly the git porcelain commands just pass the options they don't understand to the underlying core commands; and git-fetch-pack has the option -q for quiet)

-Peter

#3 lore raw
In reply to Larry Streepy
Quoted 4 lines · Larry Streepy

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

[...]

Quoted 3 lines

I have found no way to make these messages go away. When running in a "batch" mode, IMHO, interactive messages like these should not be emitted. At least there should be a switch to suppress them.

Or (as done in StGIT for some messages), only print those interactive messages when stdout is a tty, i.e. "if (isatty(1))".

Signature · 1 line
Catalin
#4 lore raw

Hi,

Quoted 5 lines · Catalin Marinas
Quoted 4 lines · Larry Streepy

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

Quoted 7 lines

[...]

Quoted 3 lines

I have found no way to make these messages go away. When running in a "batch" mode, IMHO, interactive messages like these should not be emitted. At least there should be a switch to suppress them.

Or (as done in StGIT for some messages), only print those interactive messages when stdout is a tty, i.e. "if (isatty(1))".

You mean something like this?

--
[PATCH] fetch: make things quiet when not outputting to a tty

---

 fetch-pack.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fetch-pack.c +2 -0
index c787106..9ec5479 100644
@@ -725,6 +725,8 @@ int main(int argc, char **argv)
 		nr_heads = argc - i - 1;
 		break;
 	}
+	if (!verbose && !isatty(1))
+		quiet = 1;
 	if (!dest)
 		usage(fetch_pack_usage);
 	pid = git_connect(fd, dest, uploadpack);
#5 lore raw
Quoted 14 lines · Johannes Schindelin
Quoted 5 lines
Quoted 4 lines · Larry Streepy

I run a nightly script to build and test our product. I capture all the output and email it to interested parties. One very annoying thing is the "percent done" messages that come out of git pull. It results in log files that look like this:

Quoted 7 lines

[...]

Quoted 3 lines

I have found no way to make these messages go away. When running in a "batch" mode, IMHO, interactive messages like these should not be emitted. At least there should be a switch to suppress them.

Or (as done in StGIT for some messages), only print those interactive messages when stdout is a tty, i.e. "if (isatty(1))".

You mean something like this?

[...]

fetch-pack.c int main(int argc, char **argv) · line 729

Quoted 2 lines
fetch-pack.c +2 -0
+	if (!verbose && !isatty(1))
+		quiet = 1;

Well, you might not want this to be the equivalent of --quiet as you already have an option for it. I'm not familiar to the GIT internals but it seems a bit more complicated since those messages are sent by the server. Maybe some modification to the sideband.c but both error messages and progress percentage seem to be sent on the same band #2.

Signature · 1 line
Catalin
#6 lore raw
In reply to Johannes Schindelin
Quoted 9 lines · Johannes Schindelin
Quoted 2 lines

Or (as done in StGIT for some messages), only print those interactive messages when stdout is a tty, i.e. "if (isatty(1))".

You mean something like this?

--
[PATCH] fetch: make things quiet when not outputting to a tty

Please grep for 'git.fetch-pack' again. Its output is list of object names and the refnames where they live in the remote and consumed by the later stages of git-fetch script.

#7 lore raw

Hi,

Quoted 7 lines · Junio C Hamano
Quoted 5 lines · Johannes Schindelin
Quoted 2 lines

Or (as done in StGIT for some messages), only print those interactive messages when stdout is a tty, i.e. "if (isatty(1))".

You mean something like this?

Quoted 8 lines
Quoted 4 lines

--
[PATCH] fetch: make things quiet when not outputting to a tty

Please grep for 'git.fetch-pack' again. Its output is list of object names and the refnames where they live in the remote and consumed by the later stages of git-fetch script.

Ouch. Sorry. I'll try to come up with a better patch tomorrow, and I will test that, too.

Ciao,
Dscho