From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1E54D1F619 for ; Fri, 2 Sep 2022 18:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1662143139; bh=7NKU6NN5RsM9Sm9vaGCMDnPo0nDMBLkB+NiGckDNSwk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ojj3Tjm4HW5x8G24Gh175mD0YDMiDUnPXgCjaH5hxW9/Uzzlt5ynw5h+835lTWkr7 ZgkrZzRtBkVbRIGGmFAuiEwu9l6jTdXPXTW9U2n7ldMod48XpAy9Kj356EMfWgZKz3 19Zi4zC5meLHgRie/O1tJ39Ymyy8VDaBfNIgNmRY= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] import: pass --quiet to `git gc' if STDERR isn't a tty Date: Fri, 2 Sep 2022 18:26:23 +0000 Message-Id: <20220902182624.8276-3-e@80x24.org> In-Reply-To: <20220902182624.8276-1-e@80x24.org> References: <20220902182624.8276-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: No need to pollute non-interactive output for gc use. This suppresses notifications from my `lei up --all -q' cronjob. --- lib/PublicInbox/Import.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm index 2c8f310a..04192174 100644 --- a/lib/PublicInbox/Import.pm +++ b/lib/PublicInbox/Import.pm @@ -192,7 +192,10 @@ sub _update_git_info ($$) { }; warn "$ibx->{inboxdir} index failed: $@\n" if $@; } - eval { run_die([@cmd, qw(gc --auto)]) } if $do_gc; + if ($do_gc) { + my @quiet = (-t STDERR ? () : '-q'); + eval { run_die([@cmd, qw(gc --auto), @quiet]) } + } } sub barrier {