.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" 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 .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Git::Raw::Index 3pm" .TH Git::Raw::Index 3pm "2022-10-29" "perl v5.36.0" "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::Index \- Git index class .SH "VERSION" .IX Header "VERSION" version 0.90 .SH "DESCRIPTION" .IX Header "DESCRIPTION" A Git::Raw::Index represents an index in a Git repository. .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 in-memory index. This is currently of little use. .SS "owner( )" .IX Subsection "owner( )" Retrieve the Git::Raw::Repository owning the index. .ie n .SS "add( $entry )" .el .SS "add( \f(CW$entry\fP )" .IX Subsection "add( $entry )" Add \f(CW$entry\fR to the index. \f(CW$entry\fR should either be the path of a file or alternatively a Git::Raw::Index::Entry. .ie n .SS "add_frombuffer( $path, $buffer, [$mode] )" .el .SS "add_frombuffer( \f(CW$path\fP, \f(CW$buffer\fP, [$mode] )" .IX Subsection "add_frombuffer( $path, $buffer, [$mode] )" Add or update an entry from an in-memory file. The entry will be placed at \f(CW$path\fR with the contents of \f(CW$buffer\fR. \f(CW$buffer\fR may either be string or a reference to a string. \f(CW$mode\fR is the file mode; it defaults to \f(CW0100644\fR. Returns a Git::Raw::Index::Entry object. .SS "add_all( \e%opts )" .IX Subsection "add_all( %opts )" Add or update all index entries to match the working directory. Valid fields for the \f(CW%opts\fR hash are: .IP "\(bu" 4 \&\*(L"paths\*(R" .Sp List of path patterns to add. .IP "\(bu" 4 \&\*(L"flags\*(R" .Sp Valid fields for the \f(CW%flags\fR member: .RS 4 .IP "\(bu" 8 \&\*(L"force\*(R" .Sp Forced addition of files (even if they are ignored). .IP "\(bu" 8 \&\*(L"disable_pathspec_match\*(R" .Sp Disable pathspec pattern matching against entries in \f(CW$paths\fR. .IP "\(bu" 8 \&\*(L"check_pathspec\*(R" .Sp Enable pathspec pattern matching against entries in \f(CW$paths\fR (default). .RE .RS 4 .RE .IP "\(bu" 4 \&\*(L"notification\*(R" .Sp The callback to be called for each added or updated item. Receives the \f(CW$path\fR and matching \f(CW$pathspec\fR. This callback should return \f(CW0\fR if the file should be added to the index, \f(CW\*(C`>0\*(C'\fR if it should be skipped or \f(CW\*(C`<0\*(C'\fR to abort. .ie n .SS "find( $path )" .el .SS "find( \f(CW$path\fP )" .IX Subsection "find( $path )" Find the first Git::Raw::Index::Entry which points to a given \f(CW$path\fR. If an entry cannot be found, this function will return \f(CW\*(C`undef\*(C'\fR. .ie n .SS "remove( $path )" .el .SS "remove( \f(CW$path\fP )" .IX Subsection "remove( $path )" Remove \f(CW$path\fR from the index. .SS "remove_all( \e%opts )" .IX Subsection "remove_all( %opts )" Remove all matching index entries. See \f(CW\*(C`Git::Raw::Index\->update_all()\*(C'\fR for valid \f(CW%opts\fR values. .SS "path( )" .IX Subsection "path( )" Retrieve the full path to the index file on disk. .SS "checksum( )" .IX Subsection "checksum( )" Retrieve the \s-1SHA\-1\s0 checksum over the index file, except for the last 20 bytes which is the checksum content itself. If the index does not exist on-disk an empty \s-1OID\s0 will be returned. .SS "clear( )" .IX Subsection "clear( )" Clear the index. .SS "read( [$force] )" .IX Subsection "read( [$force] )" Update the index, reading it from disk. .SS "write( )" .IX Subsection "write( )" Write the index to disk. .ie n .SS "read_tree( $tree )" .el .SS "read_tree( \f(CW$tree\fP )" .IX Subsection "read_tree( $tree )" Replace the index content with \f(CW$tree\fR. .SS "write_tree( [$repo] )" .IX Subsection "write_tree( [$repo] )" Create a new tree from the index and write it to disk. \f(CW$repo\fR optionally indicates which Git::Raw::Repository the tree should be written to. Returns a Git::Raw::Tree object. .SS "checkout( [\e%checkout_opts] )" .IX Subsection "checkout( [%checkout_opts] )" Update files in the working tree to match the contents of the index. See \f(CW\*(C`Git::Raw::Repository\->checkout()\*(C'\fR for valid \&\f(CW%checkout_opts\fR values. .SS "entry_count( )" .IX Subsection "entry_count( )" Retrieve the number of entries in the index. .SS "entries( )" .IX Subsection "entries( )" Retrieve index entries. Returns a list of Git::Raw::Index::Entry objects. .ie n .SS "add_conflict( $ancestor, $theirs, $ours)" .el .SS "add_conflict( \f(CW$ancestor\fP, \f(CW$theirs\fP, \f(CW$ours\fP)" .IX Subsection "add_conflict( $ancestor, $theirs, $ours)" Add a new conflict entry. \f(CW$ancestor\fR, \f(CW$theirs\fR and \f(CW$ours\fR should be Git::Raw::Index::Entry objects. .ie n .SS "get_conflict( $path )" .el .SS "get_conflict( \f(CW$path\fP )" .IX Subsection "get_conflict( $path )" Get the conflict entry for \f(CW$path\fR. If \f(CW$path\fR has no conflict entry, this function will return \f(CW\*(C`undef\*(C'\fR. .ie n .SS "remove_conflict( $path )" .el .SS "remove_conflict( \f(CW$path\fP )" .IX Subsection "remove_conflict( $path )" Remove \f(CW$path\fR from the index. .SS "has_conflicts( )" .IX Subsection "has_conflicts( )" Determine if the index contains entries representing file conflicts. .SS "conflict_cleanup( )" .IX Subsection "conflict_cleanup( )" Remove all conflicts in the index (entries with a stage greater than 0). .SS "conflicts( )" .IX Subsection "conflicts( )" Retrieve index entries that represent a conflict. Returns a list of Git::Raw::Index::Conflict objects. .ie n .SS "merge( $ancestor, $theirs, $ours, [\e%merge_opts] )" .el .SS "merge( \f(CW$ancestor\fP, \f(CW$theirs\fP, \f(CW$ours\fP, [\e%merge_opts] )" .IX Subsection "merge( $ancestor, $theirs, $ours, [%merge_opts] )" Merge two files as they exist in the index. \f(CW$ancestor\fR, \f(CW$theirs\fR and \&\f(CW$ours\fR should be Git::Raw::Index::Entry objects. Returns a Git::Raw::Merge::File::Result object. Valid fields for the \f(CW%merge_opts\fR hash are: .IP "\(bu" 4 \&\*(L"our_label\*(R" .Sp The name of the \*(L"our\*(R" side of conflicts. .IP "\(bu" 4 \&\*(L"their_label\*(R" .Sp The name of the \*(L"their\*(R" side of conflicts. .IP "\(bu" 4 \&\*(L"ancestor_label\*(R" .Sp The name of the common ancestor side of conflicts. .IP "\(bu" 4 \&\*(L"favor\*(R" .Sp Specify content automerging behaviour. Valid values are \f(CW"ours"\fR, \f(CW"theirs"\fR, and \f(CW"union"\fR. .IP "\(bu" 4 \&\*(L"marker_size\*(R" .Sp The size of conflict markers. .IP "\(bu" 4 \&\*(L"flags\*(R" .Sp Merge file flags. Valid values include: .RS 4 .IP "\(bu" 8 \&\*(L"merge\*(R" .Sp Create standard conflicted merge file. .IP "\(bu" 8 \&\*(L"diff3\*(R" .Sp Create diff3\-style files. .IP "\(bu" 8 \&\*(L"simplify_alnum\*(R" .Sp Condense non-alphanumeric regions for simplified diff file. .IP "\(bu" 8 \&\*(L"ignore_whitespace\*(R" .Sp Ignore all whitespace. .IP "\(bu" 8 \&\*(L"ignore_whitespace_change\*(R" .Sp Ignore changes in amount of whitespace. .IP "\(bu" 8 \&\*(L"ignore_whitespace_eol\*(R" .Sp Ignore whitespace at end of line. .IP "\(bu" 8 \&\*(L"patience\*(R" .Sp Use the \f(CW"patience diff"\fR algorithm. .IP "\(bu" 8 \&\*(L"minimal\*(R" .Sp Take extra time to find minimal diff. .RE .RS 4 .RE .SS "update_all( \e%opts )" .IX Subsection "update_all( %opts )" Update all index entries to match the working directory. Valid fields for the \&\f(CW%opts\fR hash are: .IP "\(bu" 4 \&\*(L"paths\*(R" .Sp List of path patterns to add. .IP "\(bu" 4 \&\*(L"notification\*(R" .Sp The callback to be called for each updated item. Receives the \f(CW$path\fR and matching \f(CW$pathspec\fR. This callback should return \f(CW0\fR if the file should be added to the index, \f(CW\*(C`>0\*(C'\fR if it should be skipped, or \f(CW\*(C`<0\*(C'\fR to abort. .SS "capabilities( )" .IX Subsection "capabilities( )" Retrieve the index's capabilities. Returns a hash with members \f(CW"ignore_case"\fR, \&\f(CW"no_filemode"\fR and \f(CW"no_symlinks"\fR, each indicating if the Git::Raw::Index supports the capability. .SS "version( [$version] )" .IX Subsection "version( [$version] )" Retrieve or set the index version. .SH "AUTHOR" .IX Header "AUTHOR" Alessandro Ghedini .PP Jacques Germishuys .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2012 Alessandro Ghedini. .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.