]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_mirror: shorten remote names
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:31:59 +0000 (05:31 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:57 +0000 (23:38 +0000)
The lengthy-but-human-meaningful remote names are more expensive
at runtime and increase packed-refs space.

lib/PublicInbox/LeiMirror.pm

index 2da4f8815588953289bbb7a81df73b72789afd91..04d9494c604388ca4e9c0f832b9233c653cb9ac7 100644 (file)
@@ -438,11 +438,7 @@ sub forkgroup_prep {
                }
        }
        my $key = $self->{-key} // die 'BUG: no -key';
-       my $rn = $key;
-       $rn =~ s!\A[\./]+!!s;
-       $rn =~ s/\.*?(?:\.git)?\.*?\z//s;
-       $rn =~ s![\@\{\}/:\?\[\]\^~\s\f[:cntrl:]\*]!_!isg;
-       $rn .= '-'.substr(sha256_hex($key), 0, 16);
+       my $rn = substr(sha256_hex($key), 0, 16);
        unless ($self->{dry_run}) {
                # --no-tags is required to avoid conflicts
                for ("url=$uri", "fetch=+refs/*:refs/remotes/$rn/*",