Git::R...builder(3pm)
π Git::Raw::Packbuilder β the packbuilder class, bestie π
okay so real talk, this is the docs for Git::Raw::Packbuilder from the Git::Raw family of Perl modules, and it's giving very niche but very iconic energy. Manual page name is Git::R...builder(3pm) (yes the terminal truncates it, that's just the man page header doing its thing, don't perceive it π
).
β¨ VERSION β¨
version 0.90 β that's the vibe, that's the number, periodt.
πΈ SYNOPSIS πΈ
here's the whole little serve, copied exactly because we do NOT edit code in this house:
use File::Spec::Functions qw(catfile);
use Git::Raw;
my $pb = Git::Raw::Packbuilder -> new($repo);
$pb -> insert($commit);
$pb -> write(catfile($repo -> path, 'objects', 'pack'));
so you make a builder, you shove an object in, you write the pack out. three lines, eats every time π
π¦ DESCRIPTION π¦
okay so basically: a Git::Raw::Packbuilder represents a git packfile builder. that's the whole job. it builds packfiles. no cap. π
π CONSTANTS π
these are the states the packbuilder can be in, and yes they get their own little section because they're important.
π« ADDING_OBJECTS
objects are being added to the object database. that's it, that's the state.
π« DELTAFICATION
deltas</purole> are calculated/resolved. (yes "deltification" is a real word here, we love an unhinged noun π )
β METHODS β
new( $repo )
create a new packbuilder. brand new, fresh out the box, main character energy. pass in $repo.
insert( $object, [$recursive = 1] )
insert an object β and by default, its referenced objects too. that's what the $recursive = 1 default is doing, bestie.
the $object can be any of these, and I do mean any:
Git::Raw::CommitGit::Raw::TreeGit::Raw::BlobGit::Raw::Walker
write( $path )
write the new pack and the corresponding index file to $path. both files. don't forget the index, she matters. π₯
written( )
retrieve the number of objects the packbuilder has already written out. past tense, done, slayed.
object_count( )
retrieve the total number of objects the packbuilder will write out. future tense, manifesting. β¨
threads( $count )
set the number of threads to spawn. okay so the default is a whole mood: libgit2 won't spawn any threads at all unless you tell it to. and if you set it to 0, libgit2 will autodetect the number of CPUs for you. iykyk. π§
hash( )
get the packfile's hash. a packfile's name is derived from the sorted hashing of all object names. important caveat though, and I mean it:
this is only correct after the packfile has been written. before that? no thoughts, head empty, the hash is not ready. π
callbacks( \%callbacks )
set the callbacks for the packbuilder. see the "CALLBACKS" section below, because there IS a whole section, and it IS iconic. π
π CALLBACKS π
pack_progress
during the packing of new data, this will regularly be called with the progress of the pack operation. real talk though:
be aware that this is called inline with pack building operations, so performance may be affected. don't say we didn't warn you. π
the callback receives the following integers: $stage, $current and $total.
transfer_progress
this will regularly be called with the current count of progress done by the indexer. she's chatty, she checks in often. π«Ά
the callback receives the following integers: $total_objects, $received_objects, $local_objects, $total_deltas, $indexed_deltas and $received_bytes.
that's six integers and a byte count, we love a thorough callback. β
π AUTHOR π
Jacques Germishuys <jacquesg@cpan.org> β legend behaviour, honestly. π
π LICENSE AND COPYRIGHT π
Copyright 2015 Jacques Germishuys.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
okay that's the whole page, no notes, you're gonna build packs so well π
and for the record, this was perl v5.42.3, dated 2026-08-19, from the Git::R...builder(3pm) man page. go forth and insert responsibly, bestie. π¦β¨
π¦ where this page comes from
- ubuntu stonking: libgit-raw-perl 0.90+ds-3build3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms