Git::A...ommand(3pm)
π NAME π
Git::Annex::BatchCommand β a Perl interface to git-annex --batch commands, bestie. That's it, that's the whole vibe β¨
Oh and btw, this page lives in the User Contributed Perl Documentation section, and the module itself is literally called Git::Annex::BatchCommand, iykyk π
πΈ VERSION πΈ
version 0.008 β yes she's at 0.008 and she's thriving π
π¦ SYNOPSIS π¦
okay so here's the tea, you literally do not make this class yourself:
# you should not instantiate this class yourself; use Git::Annex::batch
my $annex = Git::Annex->new("/home/spwhitton/annex");
my $batch = $annex->batch("find", "--not", "--in=here");
# see git-annex-find(1) -- `git annex find --batch --not --in here`
# prints an empty string for each file which is not present
say "foo/bar is not present in this repo" unless $batch->ask("foo/bar");
see how it prints an empty string for every file that's not present? iconic behaviour honestly π«Ά
π DESCRIPTION π
okay so this class is your girl for running git-annex commands that take the --batch option. You slide the command lines into her, she slides git-annex's responses right back at you. It's giving vending machine but make it git π₯
The whole point of using --batch commands from Perl? Keeping git-annex alive and running instead of spawning a fresh git-annex process every single time you wanna do a query or ask for a change. Not me saving all those forks π§
π METHODS π
new($annex, $cmd, @args) β¨
Boot up a batch process inside Git::Annex $annex, running the git-annex subcommand $cmd (like "setpresentkey") with the arguments @args. Slay.
π real talk though: use Git::Annex::batch instead of this method. She's the preferred one, no cap.
say($input, ...) π¬
Say one line β or a whole bunch of lines β of input to the batch command's standard input. Trailing line breaks in $input are optional, she's flexible like that π
Context matters here bestie:
- In list context, you get back a list of git-annex's responses to each item of input, all chomped. nom nom π
- In scalar context, you get the last of git-annex's responses, chomped. Just the one. Main character energy π
ask($input, ...) π
A synonym for the "say" method. Same thing, different name, she contains multitudes π
restart π
Kill and restart the --batch command. It's giving "turn it off and on again" but make it intentional π
Sometimes you need this to make sure the --batch command picks up changes that were made to the git-annex branch. Lowkey essential.
π AUTHOR π
Sean Whitton <spwhitton@spwhitton.name> β the legend themselves π«Ά
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2019-2021 by Sean Whitton <spwhitton@spwhitton.name>. Respect the queen πββοΈ
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007
GPLv3, license icon behaviour, we love to see it π
and that's the whole page bestie!! this cutie was rendered by perl v5.40.1 and dated 2025-03-04, mwah π
π¦ where this page comes from
- debian trixie: libgit-annex-perl 0.008-2 Β· GPL-3.0-or-later
- ubuntu resolute: libgit-annex-perl 0.008-2 Β· GPL-3.0-or-later
- ubuntu stonking: libgit-annex-perl 0.008-2 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms