user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH 0/2] replace: quiet down git commands
@ 2019-11-28 20:54 Eric Wong
  2019-11-28 20:54 ` [PATCH 1/2] t/replace: quiet "git fsck" invocation Eric Wong
  2019-11-28 20:54 ` [PATCH 2/2] replace: quiet "git gc" invocation Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2019-11-28 20:54 UTC (permalink / raw)
  To: meta

git fsck and gc are noisier when not run under "prove",
as git will decide to emit progress depending on whether
or not stderr is a TTY (prove makes stderr a pipe).

Eric Wong (2):
  t/replace: quiet "git fsck" invocation
  replace: quiet "git gc" invocation

 lib/PublicInbox/Import.pm     | 2 +-
 lib/PublicInbox/V2Writable.pm | 2 +-
 t/replace.t                   | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] t/replace: quiet "git fsck" invocation
  2019-11-28 20:54 [PATCH 0/2] replace: quiet down git commands Eric Wong
@ 2019-11-28 20:54 ` Eric Wong
  2019-11-28 20:54 ` [PATCH 2/2] replace: quiet "git gc" invocation Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2019-11-28 20:54 UTC (permalink / raw)
  To: meta

Test output can be a terminal if running as "perl -I lib t/$FOO.t",
and showing fsck progress is pointless for tests.
---
 t/replace.t | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/t/replace.t b/t/replace.t
index e9361856..57290f96 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -99,8 +99,9 @@ EOF
 
 	for my $dir (glob("$ibx->{inboxdir}/git/*.git")) {
 		my ($bn) = ($dir =~ m!([^/]+)\z!);
-		is(system(qw(git --git-dir), $dir, qw(fsck --strict)), 0,
-			"git fsck is clean in epoch $bn");
+		is(system(qw(git --git-dir), $dir,
+					qw(fsck --strict --no-progress)),
+			0, "git fsck is clean in epoch $bn");
 	}
 
 	my $thread_b = $ibx->over->get_thread('replace@example.com');

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] replace: quiet "git gc" invocation
  2019-11-28 20:54 [PATCH 0/2] replace: quiet down git commands Eric Wong
  2019-11-28 20:54 ` [PATCH 1/2] t/replace: quiet "git fsck" invocation Eric Wong
@ 2019-11-28 20:54 ` Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2019-11-28 20:54 UTC (permalink / raw)
  To: meta

Since we give users no indication or control of how "git gc"
runs, showing its progress is confusing.
---
 lib/PublicInbox/Import.pm     | 2 +-
 lib/PublicInbox/V2Writable.pm | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/Import.pm b/lib/PublicInbox/Import.pm
index cb25215d..8a369ee4 100644
--- a/lib/PublicInbox/Import.pm
+++ b/lib/PublicInbox/Import.pm
@@ -595,7 +595,7 @@ sub replace_oids {
 
 	return if $nreplace == 0;
 
-	run_die([@git, qw(-c gc.reflogExpire=now gc --prune=all)]);
+	run_die([@git, qw(-c gc.reflogExpire=now gc --prune=all --quiet)]);
 
 	# check that old OIDs are gone
 	my $err = 0;
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 02f313b0..ab80941a 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -1204,7 +1204,7 @@ sub unindex ($$$$) {
 
 	# ensure any blob can not longer be accessed via dumb HTTP
 	PublicInbox::Import::run_die(['git', "--git-dir=$git->{git_dir}",
-		qw(-c gc.reflogExpire=now gc --prune=all)]);
+		qw(-c gc.reflogExpire=now gc --prune=all --quiet)]);
 }
 
 sub sync_ranges ($$$) {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-28 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-28 20:54 [PATCH 0/2] replace: quiet down git commands Eric Wong
2019-11-28 20:54 ` [PATCH 1/2] t/replace: quiet "git fsck" invocation Eric Wong
2019-11-28 20:54 ` [PATCH 2/2] replace: quiet "git gc" invocation Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).