.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Git::Raw::Odb 3pm" .TH Git::Raw::Odb 3pm "2018-05-15" "perl v5.26.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Git::Raw::Odb \- Git object database class .SH "VERSION" .IX Header "VERSION" version 0.79 .SH "DESCRIPTION" .IX Header "DESCRIPTION" A Git::Raw::Odb represents a git object database. .PP \&\fB\s-1WARNING\s0\fR: The \s-1API\s0 of this module is unstable and may change without warning (any change will be appropriately documented in the changelog). .SH "METHODS" .IX Header "METHODS" .SS "new( )" .IX Subsection "new( )" Create a new object database. .ie n .SS "open( $directory )" .el .SS "open( \f(CW$directory\fP )" .IX Subsection "open( $directory )" Create a new object database and automatically add the two default backends. \&\f(CW$directory\fR should be the path to the 'objects' directory. .SS "backend_count( )" .IX Subsection "backend_count( )" Get the number of \s-1ODB\s0 backend objects. .SS "refresh( )" .IX Subsection "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 \s-1ODB.\s0 .ie n .SS "foreach( $repo, $callback )" .el .SS "foreach( \f(CW$repo\fP, \f(CW$callback\fP )" .IX Subsection "foreach( $repo, $callback )" Run \f(CW$callback\fR for every object available in the database. The callback receives a single argument, the \s-1OID\s0 of the object. A non-zero return value will terminate the loop. .ie n .SS "add_backend( $backend, $priority )" .el .SS "add_backend( \f(CW$backend\fP, \f(CW$priority\fP )" .IX Subsection "add_backend( $backend, $priority )" Add a custom backend to the \s-1ODB.\s0 The backends are checked in relative ordering, based on the value of \f(CW$priority\fR. .ie n .SS "add_alternate( $backend, $priority )" .el .SS "add_alternate( \f(CW$backend\fP, \f(CW$priority\fP )" .IX Subsection "add_alternate( $backend, $priority )" Add an alternate custom backend to the \s-1ODB.\s0 Alternate backends are always checked for objects after all the main backends have been exhausted. Writing is disabled on alternate backends. .ie n .SS "read( $id )" .el .SS "read( \f(CW$id\fP )" .IX Subsection "read( $id )" Read an object from the database. Returns a Git::Raw::Odb::Object or \f(CW\*(C`undef\*(C'\fR if the object does not exist. .ie n .SS "write( $data, type )" .el .SS "write( \f(CW$data\fP, type )" .IX Subsection "write( $data, type )" Write an object directly to the database. Returns the \s-1OID\s0 of the object. \f(CW$type\fR should be one of the values as defines in the constants section of Git::Raw::Object. .ie n .SS "hash( $data, $type )" .el .SS "hash( \f(CW$data\fP, \f(CW$type\fP )" .IX Subsection "hash( $data, $type )" Determine the object-ID (sha1 hash) of \f(CW$data\fR. \f(CW$type\fR should be one of the values as defined in the constants section of Git::Raw::Object. .SH "AUTHOR" .IX Header "AUTHOR" Jacques Germishuys .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2016 Jacques Germishuys. .PP This program is free software; you can redistribute it and/or modify it under the terms of either: the \s-1GNU\s0 General Public License as published by the Free Software Foundation; or the Artistic License. .PP See http://dev.perl.org/licenses/ for more information.