Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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.

TIA!
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"; }

In reply to Git::Wrapper script choking on larger directories by wrinkles

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-20 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found