.\" 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::Annex 3pm" .TH Git::Annex 3pm "2022-12-24" "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::Annex \- Perl interface to git\-annex repositories .SH "VERSION" .IX Header "VERSION" version 0.008 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& my $annex = Git::Annex\->new("/home/spwhitton/annex"); \& \& # run \`git annex unused\` and then \`git log\` to get information about \& # unused git annex keys \& my $unused_files \& = $self\->unused(used_refspec => "+refs/heads/master", log => 1); \& for my $unused_file (@$unused_files) { \& say "unused file " . $unused_file\->{key} . ":"; \& say ""; \& say " $_" for $unused_file\->{log_lines}; \& say ""; \& say "you can drop it with: \`git annex dropunused " \& . $unused_file\->{number} . "\`"; \& say ""; \& } \& \& # embedded Git::Wrapper instance with shortcut to access annex subcommands \& say for $annex\->annex\->find(qw(\-\-not \-\-in here)); \& $annex\->annex\->copy(qw(\-t cloud \-\-in here \-\-and \-\-lackingcopies=1)); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" An instance of the Git::Annex class represents a git repository in which \f(CW\*(C`git annex init\*(C'\fR has been run. This module provides some useful methods for working with such repositories from Perl. See for more information on git-annex. .SH "ATTRIBUTES" .IX Header "ATTRIBUTES" .SS "toplevel" .IX Subsection "toplevel" The root of the repository. .SS "git" .IX Subsection "git" An instance of Git::Wrapper initialised in the repository. .SS "annex" .IX Subsection "annex" Gives access to git-annex subcommands in the same way that Git::Annex::git gives access to git subcommands. So .PP .Vb 1 \& $self\->git\->annex("contentlocation", $key); .Ve .PP may be written .PP .Vb 1 \& $self\->annex\->contentlocation($key); .Ve .SH "METHODS" .IX Header "METHODS" .SS "new($dir)" .IX Subsection "new($dir)" Instantiate an object representing a git-annex located in \f(CW$dir\fR. .SS "unused(%opts)" .IX Subsection "unused(%opts)" Runs \f(CW\*(C`git annex unused\*(C'\fR and returns a hashref containing information on unused files. .PP The information is cached inside the \f(CW\*(C`.git/annex\*(C'\fR directory. This means that a user can keep running your script without repeatedly executing expensive \f(CW\*(C`git annex\*(C'\fR and \f(CW\*(C`git log\*(C'\fR commands. .PP Optional arguments: .IP "log" 4 .IX Item "log" If true, run \f(CW\*(C`git log \-\-stat \-S\*(C'\fR on each unused file, to see what filenames the unused data had if and when it was used data in the annex. .Sp Defaults to false, but if there is log data in the cache it will always be returned. .IP "from" 4 .IX Item "from" Corresponds to the \f(CW\*(C`\-\-from\*(C'\fR option to \f(CW\*(C`git annex unused\*(C'\fR. .IP "used_refspec" 4 .IX Item "used_refspec" Corresponds to the \f(CW\*(C`\-\-used\-refspec\*(C'\fR option to \f(CW\*(C`git annex unused\*(C'\fR. .Sp Defaults to the \f(CW\*(C`annex.used\-refspec\*(C'\fR git config key if set, or \&\f(CW\*(C`+refs/heads/*:\-refs/heads/synced/*\*(C'\fR. .SS "abs_contentlocation($key)" .IX Subsection "abs_contentlocation($key)" Returns an absolute path to the content for git-annex key \f(CW$key\fR. .ie n .SS "batch($cmd, @args)" .el .SS "batch($cmd, \f(CW@args\fP)" .IX Subsection "batch($cmd, @args)" Instantiate a \f(CW\*(C`Git::Annex::BatchCommand\*(C'\fR object by starting up a git-annex \f(CW\*(C`\-\-batch\*(C'\fR command. .PP .Vb 3 \& my $batch = $annex\->batch("find", "\-\-in=here"); \& say "foo/bar annexed content is present in this repo" \& if $batch\->say("foo/bar"); \& \& # kill the batch process: \& undef $batch; .Ve .SH "AUTHOR" .IX Header "AUTHOR" Sean Whitton .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2019\-2021 by Sean Whitton . .PP This is free software, licensed under: .PP .Vb 1 \& The GNU General Public License, Version 3, June 2007 .Ve