git-gc-cron 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +7 -1
- data/features/cli.feature +1 -1
- data/lib/git_gc_cron/cli.rb +3 -2
- data/lib/git_gc_cron/version.rb +1 -1
- metadata +1 -1
data/README
CHANGED
@@ -17,7 +17,7 @@ As user or as root:
|
|
17
17
|
|
18
18
|
Put this into the system crontab (for example fcron on Linux):
|
19
19
|
|
20
|
-
%weekly,nice(10),runas(
|
20
|
+
%weekly,nice(10),runas(git) * * git-gc-cron /var/spool/gitosis/repositories
|
21
21
|
%weekly,nice(10),runas(me) * * git-gc-cron /home/me/myprojects /home/me/myotherprojects
|
22
22
|
|
23
23
|
or into your personal crontab, if you like:
|
@@ -26,3 +26,9 @@ or into your personal crontab, if you like:
|
|
26
26
|
|
27
27
|
|
28
28
|
git-gc-cron takes any number of paths to traverse as argument.
|
29
|
+
|
30
|
+
To see the progress you can watch the output of ps or top. For each repo it
|
31
|
+
compresses git-gc-cron changes the process name of the subprocess "git gc" to
|
32
|
+
something more useful:
|
33
|
+
|
34
|
+
(#1/10 /var/spool/gitosis/repositories/myproject.git) git
|
data/features/cli.feature
CHANGED
@@ -8,7 +8,7 @@ Feature: CLI
|
|
8
8
|
And a checked out repo "repos1/def/xyz"
|
9
9
|
And a bare repo "repos2/ghi.git"
|
10
10
|
And a bare repo "repos3/jkl.git"
|
11
|
-
When I run "git-gc-cron
|
11
|
+
When I run "git-gc-cron repos1 repos2"
|
12
12
|
Then the repo "repos1/abc" should be packed
|
13
13
|
And the repo "repos1/def/xyz" should be packed
|
14
14
|
And the repo "repos2/ghi.git" should be packed
|
data/lib/git_gc_cron/cli.rb
CHANGED
@@ -3,9 +3,10 @@ module GitGcCron
|
|
3
3
|
|
4
4
|
def self.start
|
5
5
|
ARGV.each do |base|
|
6
|
-
Dir["#{base}/**/{.git,*.git}"]
|
6
|
+
repos = Dir["#{base}/**/{.git,*.git}"]
|
7
|
+
repos.each_with_index do |repo_path, i|
|
7
8
|
Dir.chdir(repo_path) do
|
8
|
-
system "git gc -q"
|
9
|
+
system ["git", "(##{i + 1}/#{repos.size + 1} #{repo_path}) git"], "gc", "-q"
|
9
10
|
end
|
10
11
|
end
|
11
12
|
end
|
data/lib/git_gc_cron/version.rb
CHANGED