@matheusbsbs / matheus-bagliano / commits / 86118bcb46
Fork 0

pack-object: squelch eye-candy on non-tty

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. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed May 5, 2006 at 03:20 UTC 86118bcb463e3f34b3df21d550335a40586dfb66
1 file changed +5
pack-objects.c
+5
@@ -1239,6 +1239,7 @@ int main(int argc, char **argv)
1239
1240 setup_git_directory();
1241
1242 + progress = isatty(2);
1243 for (i = 1; i < argc; i++) {
1244 const char *arg = argv[i];
1245
@@ -1269,6 +1270,10 @@ int main(int argc, char **argv)
1270 usage(pack_usage);
1271 continue;
1272 }
1273 + if (!strcmp("--progress", arg)) {
1274 + progress = 1;
1275 + continue;
1276 + }
1277 if (!strcmp("-q", arg)) {
1278 progress = 0;
1279 continue;