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.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 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 E7B281F4BD; Thu, 10 Oct 2019 09:43:42 +0000 (UTC) Date: Thu, 10 Oct 2019 09:43:42 +0000 From: Eric Wong To: "Eric W. Biederman" Cc: meta@public-inbox.org Subject: Re: [PATCH 2/4] PublicInbox::Config: Process mailboxes in sorted order Message-ID: <20191010094342.r57ubvl75trauj6b@dcvr> References: <87imp05hlm.fsf@alyssa.is> <20191008001050.rwd7bh7cek7qrydi@dcvr> <87wodfctwd.fsf@x220.int.ebiederm.org> <20191008221108.3wsso25kviiwd7ek@dcvr> <87wodec1um.fsf@x220.int.ebiederm.org> <20191008224104.GA24142@dcvr> <87h84ibb9m.fsf@x220.int.ebiederm.org> <87wode9vxw.fsf_-_@x220.int.ebiederm.org> <87h84i9vta.fsf_-_@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <87h84i9vta.fsf_-_@x220.int.ebiederm.org> List-Id: "Eric W. Biederman" wrote: > > Date: Thu, 16 May 2019 19:26:47 -0500 > > To make the results reproducible and comprehensible when > a large number of mail boxes are being processed process the > mail boxes in sorted order, instead of in random hash order. > > Signed-off-by: "Eric W. Biederman" > --- > lib/PublicInbox/Config.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/PublicInbox/Config.pm b/lib/PublicInbox/Config.pm > index 9f3f8df7eeaa..9ec00b0ddb6d 100644 > --- a/lib/PublicInbox/Config.pm > +++ b/lib/PublicInbox/Config.pm > @@ -128,7 +128,7 @@ sub each_inbox { > } > } else { > my %seen; > - foreach my $k (keys %$self) { > + foreach my $k (sort keys %$self) { > $k =~ m!\Apublicinbox\.([^/]+)\.mainrepo\z! or next; > next if $seen{$1}; > $seen{$1} = 1; I'm not sure if that code path happens outside of tests. If it's parsing "git config -l" output, it'll use section_order which preserves the ordering of the config file. Will take a deeper look tomorrow (and possibly rewrite those tests to parse a scalarref instead of just taking a hashref).