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::Commit
  • Git::Raw::Tree
  • Git::Raw::Blob
  • Git::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. πŸ‘‘


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