Arch::...Bunches(3pm)
β¨ Arch::RevisionBunches β bestie edition β¨
okay so this is Arch::RevisionBunches, a Perl module from the User Contributed Perl Documentation collection, and it's literally here to manage bunches of related revisions π
πΈ NAME πΈ
Arch::RevisionBunches β manage bunches of related revisions π
π¦ SYNOPSIS π¦
no thoughts, just vibes, and also this exact code:
use Arch::RevisionBunches;
use Arch::Tree;
my $rb = Arch::RevisionBunches->new;
my $tree = Arch::Tree->new(".", own_logs => 1);
$rb->add_revision_descs($tree->get_history_revision_descs);
$rb->rebunch(25); # the default is 50
foreach my $bunch ($rb->get) {
print "$bunch->{version}\n";
print " $_->{name}\t$_->{summary}\n"
foreach @{$bunch->{revision_descs}};
}
foreach my $bunch ($rb->reverse_revision_descs->rebunch(30)) {
print $bunch->{name1};
print " .. $bunch->{name2}" if $bunch->{name2};
print " ($bunch->{daysago1}";
print " .. $bunch->{daysago2}" if $bunch->{name2};
print " days ago)\n";
}
periodt. π
π DESCRIPTION π
so basically this class is the wingman for front-ends that need to group revisions together π«Ά. and why does that matter?? because when the version you're showing has, like, thousands of revisions, dumping them all at once is giving chaos π. the front-end can decide to show expandable bunches of 100 revisions each. iconic behaviour honestly.
there's support for revision descriptions β that's summary, date, creator, email, and in some cases the associated file name and/or the associated version. slay.
there's a constraint, and it's a by-convention thing: one bunch may only contain revisions of the same version, and the ones associated with the same file if applicable. it's possible to define an order of versions. it's also possible to recreate bunches (that's rebunch) using a different number of revisions. BUT β and this is important, bestie β that constraint defines the actual number of revisions in different bunches, so it is not guaranteed to be the same. the vibes are flexible, the count is flexible, that's just how it is π
π METHODS π
the following methods are available:
new, init, add_revision_descs, versions, rebunch, get, clear, reverse_revision_descs, versions, filepaths.
(yes, versions really is listed twice in there. no cap, that's just the list.)
β new [%args]
construct an Arch::RevisionBunches object β¨
the %args get passed straight to the init method, no middleman.
β init [%args]
the %args keys may be:
bunch_sizeβ use this as the default bunch size instead of50πΈmax_sumlenβ maximal summary length to keep, including trailing ellipsis; must be greater than 5 β οΈversionβ if set, then all revisions are assumed to be of one version; otherwise multiple versions are assumed π¦final_revisionβ the final revision for which the revision bunches are constructedfinal_filepathβ the final filepath for which the revision bunches are constructed
ngl, those last two%argskeys,final_revisionandfinal_filepath? they are not really used yet. the author said it, not me π
β add_revision_descs [%constant_fields]
add revision descriptions, which is an arrayref of hashes π. go look at the other classes that return such revision descriptions if you need the tea.
if the %constant_fields is given, then add these to all revision descriptions (rarely needed, bestie).
return the object β which means you can chain a get or rebunch method call right onto it. chain energy π₯
β rebunch [bunch_size]
group newly added revisions if no bunch_size is specified. otherwise, regroup all revisions using a given bunch_size. the default bunch size may be specified in the constructor β¨
return the same thing get does.
β get
return bunches β that's an arrayref in scalar context, an array in list context π
each bunch is a hashref with these keys:
revision_descs
name1 daysago1 time1 tz1
name2 daysago2 time2 tz2
size
num_creators
num_other_creators
main_creator
main_email
creator
name
date
summary
and optionally "version", "is_missing" and "filepath" if applicable π
this method implicitly calls rebunch with no parameter if new revision descriptions were added that are not bunched yet. it's proactive like that π
β clear
clear all bunches and their revision descriptions π§Ήβ¨
β reverse_revision_descs
effectivelly empty all revision descriptions (both old and new) and readd them in the reverse order π
return the object β which means you can chain a get or rebunch method call. yes, same deal as before, we love consistency π«Ά
β versions
return distinct versions that participated in all bunches. return an empty arrayref if not applicable, i.e. if version is given in the constructor π
β filepaths
return distinct filepaths that participated in all bunches. return an empty arrayref if not applicable, i.e. if revision descriptions have no filepath π
π BUGS π
waiting for your reports. π like, genuinely. the author is just sitting there. bestie, send the report.
π AUTHORS π
Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel). a legend, fr fr.
π SEE ALSO π
for more information, see Arch::Tree, Arch::Log, Arch::Session, Arch::Library. go read them, they're all connected, iykyk β¨
and that's the whole page, bestie!! this one's from perl v5.20.2, dated 2005-02-21, and it's part of the User Contributed Perl Documentation β so go forth, bunch those revisions, and slay πππ¦
π¦ where this page comes from
- ubuntu jammy: libarch-perl 0.5.2-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms