Git::Raw::Odb(3pm)
π Git::Raw::Odb β the manual, but make it bestie π
okay so you're looking at Git::Raw::Odb(3pm), which is the perl doc for the Git object database class, and honestly? it's a whole vibe. let's get into it π«Ά
β¨ VERSION β¨
version 0.90 β that's what we're working with, no cap π
πΈ DESCRIPTION πΈ
A Git::Raw::Odb represents a git object database. that's it, that's the whole lore π
β οΈ WARNING: the API of this module is unstable and may change without warning. any change will be appropriately documented in the changelog, so like, don't get too attached bestie π
π METHODS π
π¦ new( )
Create a new object database. fresh start, main character energy β¨
π¦ open( $directory )
Create a new object database and automatically add the two default backends. $directory should be the path to the 'objects' directory π β yes, that one, the objects one, don't get it twisted.
π¦ backend_count( )
Get the number of ODB backend objects. counting. we love to see it π’
π¦ refresh( )
Refresh the object database to load newly added files. if the object databases have changed on disk while the library is running, this function will force a reload of the underlying indexes. use this method when you're confident that an external application has tampered with the ODB π β like, confident-confident. it's giving "i know something changed and i'm choosing to trust the filesystem."
π¦ foreach( $repo, $callback )
Run $callback for every object available in the database. the callback receives a single argument β that's the OID of the object. a non-zero return value will terminate the loop π so if you wanna bail early, just return something truthy. iykyk.
π¦ add_backend( $backend, $priority )
Add a custom backend to the ODB. the backends are checked in relative ordering, based on the value of $priority. so like, priority is a ranking, bestie π
π¦ add_alternate( $backend, $priority )
Add an alternate custom backend to the ODB. alternate backends are always checked for objects after all the main backends have been exhausted. also: writing is disabled on alternate backends π«βοΈ β look, don't try it, read-only is read-only.
π¦ read( $id )
Read an object from the database. returns a Git::Raw::Odb::Object, or "undef" if the object does not exist π (no object, no problem, you just get undef).
π¦ write( $data, type )
Write an object directly to the database. returns the OID of the object. $type should be one of the values as defines in the constants section of Git::Raw::Object π (yes, that's the original wording β the constants live over there, go look).
π¦ hash( $data, $type )
Determine the object-ID (sha1 hash) of $data. $type should be one of the values as defined in the constants section of Git::Raw::Object π same energy, just hashing instead of writing.
π AUTHOR π
Jacques Germishuys <jacquesg@cpan.org> β legend behavior, fr fr π«Ά
π LICENSE AND COPYRIGHT π
Copyright 2016 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 and that's the whole page π this doc rode in on perl v5.42.3 and it's dated 2026-08-19 β so yeah, a lil time traveler, but she ate π
slay, go write some objects, 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