Skip to content

Commit

Permalink
pack-object: squelch eye-candy on non-tty
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 5, 2006
1 parent 188a634 commit 86118bc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 86118bc

Please sign in to comment.