Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Git::Wrapper script choking on larger directories

by wrinkles (Pilgrim)
on Mar 30, 2012 at 05:34 UTC ( #962535=perlquestion: print w/replies, xml ) Need Help??
wrinkles has asked for the wisdom of the Perl Monks concerning the following question:

My script loops through a list of directory paths. In each loop the current directory is rsync'd to a common destination and then committed to a git repository.

My problem is that upon encountering a larger directories (e.g. 220 files, 1.5 MB), the script freezes after the rsync, apparently during the git add.

Is there a way around this? I could manually commit the whole destination directory manually, but I like to commit in smaller chunks, and I prefer to let the script do the work.

The script uses Git::Wrapper and File::Rsync. The git repo already exist before the script is run.

chdir "$web_root"; my $repo = Git::Wrapper->new('.'); foreach my $plugin ( @plugins) { my $dir = File::Rsync->new({ exclude => $rsync_exclude, archive => 1 + }); my $src = $plugin . '/'; $dir->exec({src => $src, dest => $cgi_path}) or warn "$plugin : rsyn +c failed.\n"; say "$plugin installation was successful."; # final message before t +he script freezes on larger directories my $msg = "Plugin: $plugin"; chdir $web_root; $repo->add( '.') or warn "Successful git-add of $plugin \n."; $repo->commit({ all => 1, message => $msg }) or warn "Successful git + committed $plugin\n"; say "commit complete"; my $output = $repo->log(); say "$output"; }

Replies are listed 'Best First'.
Re: Git::Wrapper script choking on larger directories
by Anonymous Monk on Mar 30, 2012 at 07:06 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://962535]
Approved by Eliya
[stevieb]: did my pull request challenge today, Locale::gettext. Weird layout for a dist, and I have no idea how to use it, but it's always nice when you can force someone else's work be use strict; and use warnings; compliant :)
[stevieb]: ahem... s/no idea how to use it/didn't read enough as to what it's used for/
[stevieb]: interestingly enough, someone else got my Devel::Examine:: Subs distribution for their PRC, and I applaud the change. This dist is extremely complicated and mostly obfu, but the person doing it understood PPI enough to change...
[stevieb]: ...something I had overlooked in the extreme depths of the core functionality. After merging, then a couple of extra tweaks, I still have 100% test coverage. Yay for people who write tests!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2017-01-24 01:16 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (199 votes). Check out past polls.