From 1fce051ea1d2b5f514dd41408bdc2dca0bd33b2e Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 28 Jan 2011 04:40:29 +0530 Subject: [PATCH] add -prune to find commands Apparently it makes a huge difference with some kinds of network drives (guess which company's software ;-) http://groups.google.com/group/gitolite/browse_thread/thread/66b888f11dc5a365 --- src/gitolite.pm | 4 ++-- src/gl-install | 2 +- src/gl-mirror-sync | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index 9bdf456..e2f24f4 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -146,7 +146,7 @@ sub list_phy_repos my @phy_repos; wrap_chdir("$ENV{GL_REPO_BASE_ABS}"); - for my $repo (`find . -type d -name "*.git"`) { + for my $repo (`find . -type d -name "*.git" -prune`) { chomp ($repo); $repo =~ s(\./(.*)\.git$)($1); push @phy_repos, $repo; @@ -538,7 +538,7 @@ sub expand_wild chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n"; my $count = 0; - for my $actual_repo (`find . -type d -name "*.git"|sort`) { + for my $actual_repo (`find . -type d -name "*.git" -prune|sort`) { chomp ($actual_repo); $actual_repo =~ s/^\.\///; $actual_repo =~ s/\.git$//; diff --git a/src/gl-install b/src/gl-install index e3734fc..4eb9e0a 100755 --- a/src/gl-install +++ b/src/gl-install @@ -94,7 +94,7 @@ EOF # finally, hooks must be propagated to all the repos in case they changed chdir("$ENV{GL_REPO_BASE_ABS}") or die "chdir $ENV{GL_REPO_BASE_ABS} failed: $!\n"; -for my $repo (`find . -type d -name "*.git"`) { +for my $repo (`find . -type d -name "*.git" -prune`) { chomp ($repo); # propagate our own, plus any local admin-defined, hooks ln_sf("$GL_ADMINDIR/hooks/common", "*", "$repo/hooks"); diff --git a/src/gl-mirror-sync b/src/gl-mirror-sync index 60458a8..e946ec0 100755 --- a/src/gl-mirror-sync +++ b/src/gl-mirror-sync @@ -14,7 +14,7 @@ ssh $mirror cat \$HOME/.gitolite.rc | expand | egrep '^ *\$GL_SLAVE_MODE *= *1; exit 1; } -find . -type d -name "*.git" | cut -c3- | sort | while read r +find . -type d -name "*.git" -prune | cut -c3- | sort | while read r do cd $HOME; cd $REPO_BASE; cd $r printf "$r "