git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH/RFC (git-core)] squelch pack-object eye-candy on non-tty

From
Junio C Hamano <junkio@cox.net>
Date
May 5, 2006, 10:20 UTC
Message-ID
<7vmzdwzsar.fsf@assigned-by-dhcp.cox.net>

One of my post-update scripts runs a git-fetch into a separate repository and sends the results back to me (2>&1); I end up getting this in the mail:

    Generating pack...
    Done counting 180 objects.
    Result has 131 objects.
    Deltifying 131 objects.
       0% (0/131) done^M   1% (2/131) done^M...
This defaults not to do the progress report when not on a tty.

You could give --progress to force the progress report, but let's not bother even documenting it nor mentioning it in the usage string.

---
diff --git a/pack-objects.c b/pack-objects.c
index 6604338..53caed4 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -1239,6 +1239,7 @@ int main(int argc, char **argv)
 
 	setup_git_directory();
 
+	progress = isatty(2);
 	for (i = 1; i < argc; i++) {
 		const char *arg = argv[i];
 
@@ -1269,6 +1270,10 @@ int main(int argc, char **argv)
 					usage(pack_usage);
 				continue;
 			}
+			if (!strcmp("--progress", arg)) {
+				progress = 1;
+				continue;
+			}
 			if (!strcmp("-q", arg)) {
 				progress = 0;
 				continue;
Next: Johannes Schindelin
Message 1 of 2 in “squelch pack-object eye-candy on non-tty”
  1. squelch pack-object eye-candy on non-ttyJunio C Hamano, May 5, 2006
  2. Johannes SchindelinMay 5, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.