user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH] t/v2writable.t: force more consistent "git log" output
@ 2019-01-10  3:26  9% Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2019-01-10  3:26 UTC (permalink / raw)
  To: meta; +Cc: Johannes Berg

This should probably use lower-level git plumbing, but until
then, consistently add a bunch of --no-* options to "git log"
to get more consistent output.

Noticed-by: Johannes Berg
  https://public-inbox.org/meta/1538164205.14416.76.camel@sipsolutions.net/
---
 t/v2writable.t | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/v2writable.t b/t/v2writable.t
index c7eeee9..a649a5b 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -201,13 +201,14 @@ EOF
 };
 {
 	local $ENV{NPROC} = 2;
-	my @before = $git0->qx(qw(log --pretty=oneline));
-	my $before = $git0->qx(qw(log --pretty=raw --raw -r --no-abbrev));
+	my @log = qw(log --no-decorate --no-abbrev --no-notes --no-color);
+	my @before = $git0->qx(@log, qw(--pretty=oneline));
+	my $before = $git0->qx(@log, qw(--pretty=raw --raw -r));
 	$im = PublicInbox::V2Writable->new($ibx, 1);
 	is($im->{partitions}, 1, 'detected single partition from previous');
 	my $smsg = $im->remove($mime, 'test removal');
 	$im->done;
-	my @after = $git0->qx(qw(log --pretty=oneline));
+	my @after = $git0->qx(@log, qw(--pretty=oneline));
 	my $tip = shift @after;
 	like($tip, qr/\A[a-f0-9]+ test removal\n\z/s,
 		'commit message propagated to git');
@@ -219,7 +220,7 @@ EOF
 	my $srch = $ibx->search->reopen;
 	my $mset = $srch->query('m:'.$smsg->mid, { mset => 1});
 	is($mset->size, 0, 'no longer found in Xapian');
-	my @log1 = qw(log -1 --pretty=raw --raw -r --no-abbrev --no-renames);
+	my @log1 = (@log, qw(-1 --pretty=raw --raw -r --no-renames));
 	is($srch->{over_ro}->get_art($num), undef,
 		'removal propagated to Over DB');
 
-- 
@@ -201,13 +201,14 @@ EOF
 };
 {
 	local $ENV{NPROC} = 2;
-	my @before = $git0->qx(qw(log --pretty=oneline));
-	my $before = $git0->qx(qw(log --pretty=raw --raw -r --no-abbrev));
+	my @log = qw(log --no-decorate --no-abbrev --no-notes --no-color);
+	my @before = $git0->qx(@log, qw(--pretty=oneline));
+	my $before = $git0->qx(@log, qw(--pretty=raw --raw -r));
 	$im = PublicInbox::V2Writable->new($ibx, 1);
 	is($im->{partitions}, 1, 'detected single partition from previous');
 	my $smsg = $im->remove($mime, 'test removal');
 	$im->done;
-	my @after = $git0->qx(qw(log --pretty=oneline));
+	my @after = $git0->qx(@log, qw(--pretty=oneline));
 	my $tip = shift @after;
 	like($tip, qr/\A[a-f0-9]+ test removal\n\z/s,
 		'commit message propagated to git');
@@ -219,7 +220,7 @@ EOF
 	my $srch = $ibx->search->reopen;
 	my $mset = $srch->query('m:'.$smsg->mid, { mset => 1});
 	is($mset->size, 0, 'no longer found in Xapian');
-	my @log1 = qw(log -1 --pretty=raw --raw -r --no-abbrev --no-renames);
+	my @log1 = (@log, qw(-1 --pretty=raw --raw -r --no-renames));
 	is($srch->{over_ro}->get_art($num), undef,
 		'removal propagated to Over DB');
 
-- 
EW

^ permalink raw reply related	[relevance 9%]

Results 1-1 of 1 | reverse | sort options + mbox downloads above
-- links below jump to the message on this page --
2019-01-10  3:26  9% [PATCH] t/v2writable.t: force more consistent "git log" output 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).