From 9e8f3256e5891841094f43e684b4a5b420bdb7ab Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 28 Nov 2022 05:31:59 +0000 Subject: [PATCH] lei_mirror: shorten remote names The lengthy-but-human-meaningful remote names are more expensive at runtime and increase packed-refs space. --- lib/PublicInbox/LeiMirror.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 2da4f881..04d9494c 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -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/*", -- 2.44.0