App-reposdb

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    See reposdb.

DESCRIPTION
    "repos.db" is a SQLite database that lists repository names along with
    some extra data. They have various uses, but my first use-case for this
    is to store last commit/status/pull time (updated via a post-commit git
    hook or "gitwrap"). This is useful to speed up like syncing of
    repositories in "Git::Bunch" that wants to find out which of the
    hundreds/thousand+ git repositories are "the most recently used" to
    prioritize these repositories first. Using information from "repos.db"
    is faster than having to "git status" or even stat() each repository.

FUNCTIONS
  add_repo_tag
    Usage:

     add_repo_tag(%args) -> [status, msg, payload, meta]

    Add a tag to a repo (by default the current repo).

    This function is not exported.

lib/App/reposdb.pm  view on Meta::CPAN

    v => 1.1,
    summary => 'Manipulate repos.db',
    description => <<'_',

`repos.db` is a SQLite database that lists repository names along with some
extra data. They have various uses, but my first use-case for this is to store
last commit/status/pull time (updated via a post-commit git hook or `gitwrap`).
This is useful to speed up like syncing of repositories in `Git::Bunch` that
wants to find out which of the hundreds/thousand+ git repositories are "the most
recently used" to prioritize these repositories first. Using information from
`repos.db` is faster than having to `git status` or even stat() each repository.

_
};

sub _complete_repo {
    my %args = @_;
    my $word    = $args{word} // '';
    my $cmdline = $args{cmdline};
    my $r       = $args{r};

lib/App/reposdb.pm  view on Meta::CPAN


=head1 DESCRIPTION


C<repos.db> is a SQLite database that lists repository names along with some
extra data. They have various uses, but my first use-case for this is to store
last commit/status/pull time (updated via a post-commit git hook or C<gitwrap>).
This is useful to speed up like syncing of repositories in C<Git::Bunch> that
wants to find out which of the hundreds/thousand+ git repositories are "the most
recently used" to prioritize these repositories first. Using information from
C<repos.db> is faster than having to C<git status> or even stat() each repository.

=head1 FUNCTIONS


=head2 add_repo_tag

Usage:

 add_repo_tag(%args) -> [status, msg, payload, meta]

script/_reposdb-inline  view on Meta::CPAN

# ABSTRACT: Completer script for reposdb-inline

use 5.010;
use strict;
use warnings;

die "Please run this script under shell completion\n" unless $ENV{COMP_LINE} || $ENV{COMMAND_LINE};

my $args = {program_name=>"reposdb-inline",read_config=>0,read_env=>0,skip_format=>undef,subcommands=>{ls=>"/App/reposdb/list_repos","remove-all-tags"=>"/App/reposdb/remove_all_repo_tags","remove-tag"=>"/App/reposdb/remove_repo_tag",touch=>"/App/repo...

my $meta = {_orig_args_as=>undef,_orig_result_naked=>undef,args_as=>"hash",description=>"\n`repos.db` is a SQLite database that lists repository names along with some\nextra data. They have various uses, but my first use-case for this is to store\nla...

my $sc_metas = do{my$a={ls=>{_orig_args_as=>undef,_orig_result_naked=>undef,args=>{detail=>{cmdline_aliases=>{l=>{}},schema=>["bool",{},{}],tags=>["category:field-selection"]},has_tags=>{element_completion=>sub{package App::reposdb;use warnings;use s...

my $copts = {format=>{default=>undef,getopt=>"format=s",handler=>sub{package Perinci::CmdLine::Base;use warnings;use strict;no feature;use feature ':5.10';my($go, $val, $r) = @_;$$r{'format'} = $val},is_settable_via_config=>1,schema=>["str*","in",["t...

my $r = {};

# get words
my $shell;
my ($words, $cword);

script/_reposdb-inline  view on Meta::CPAN

#    };
#
#    # prepare filter_func
#
#    # from the filter option
#    my $filter;
#    if ($args{filter} && !ref($args{filter})) {
#        my @seqs = split /\s*\|\s*/, $args{filter};
#        $filter = sub {
#            my $name = shift;
#            my @st = stat($name) or return 0;
#            my $mode = $st[2];
#            my $pass;
#          SEQ:
#            for my $seq (@seqs) {
#                my $neg = sub { $_[0] };
#                for my $c (split //, $seq) {
#                    if    ($c eq '-') { $neg = sub { $_[0] ? 0 : 1 } }
#                    elsif ($c eq 'r') { next SEQ unless $neg->($mode & 0400) }
#                    elsif ($c eq 'w') { next SEQ unless $neg->($mode & 0200) }
#                    elsif ($c eq 'x') { next SEQ unless $neg->($mode & 0100) }

script/_reposdb-inline  view on Meta::CPAN

#        my $value = *{$_[0]}{$type};
#        $value = $$value if $type eq 'SCALAR';
#        if (defined $value) {
#            if ($type eq 'IO') {
#                my @stats = qw(device inode mode links uid gid rdev size
#                               atime mtime ctime blksize blocks);
#                undef $value;
#                $value->{stat} = YAML::Old::Node->new({});
#                if ($value->{fileno} = fileno(*{$_[0]})) {
#                    local $^W;
#                    map {$value->{stat}{shift @stats} = $_} stat(*{$_[0]});
#                    $value->{tell} = tell(*{$_[0]});
#                }
#            }
#            $ynode->{$type} = $value;
#        }
#    }
#    return $ynode;
#}
#
#sub yaml_load {

script/reposdb-inline  view on Meta::CPAN

     [repo]

=head1 DESCRIPTION

C<repos.db> is a SQLite database that lists repository names along with some
extra data. They have various uses, but my first use-case for this is to store
last commit/status/pull time (updated via a post-commit git hook or C<gitwrap>).
This is useful to speed up like syncing of repositories in C<Git::Bunch> that
wants to find out which of the hundreds/thousand+ git repositories are "the most
recently used" to prioritize these repositories first. Using information from
C<repos.db> is faster than having to C<git status> or even stat() each repository.

=head1 SUBCOMMANDS

=head2 B<ls>

List repositories registered in repos.db.

=head2 B<remove-all-tags>

Remove all tags from a repo (by default the current repo).



( run in 0.545 second using v1.01-cache-2.11-cpan-49f99fa48dc )