summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Linus Torvalds <torvalds@osdl.org>2006-05-22 19:28:37 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-05-23 00:31:36 -0700
commit4adcea995e97361d0900aaf27c60fad0b03b9ad1 (patch)
tree405eaf8d698a6199aa14219d362e65e719ade914
parentcvsimport: introduce -L<imit> option to workaround memory leaks (diff)
downloadtgif-4adcea995e97361d0900aaf27c60fad0b03b9ad1.tar.xz
cvsimport: repack every kilo-commits.
Signed-off-by: Linus Torvalds <torvalds@osdl.org> Acked-by: Martin Langhoff <martin@catalyst.net.nz> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rwxr-xr-xgit-cvsimport.perl6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 6c232c0d4b..712cdc0e32 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -853,10 +853,14 @@ while(<CVS>) {
} elsif($state == 9 and /^\s*$/) {
$state = 10;
} elsif(($state == 9 or $state == 10) and /^-+$/) {
- if ($opt_L && $commitcount++ >= $opt_L) {
+ $commitcount++;
+ if ($opt_L && $commitcount > $opt_L) {
last;
}
commit();
+ if (($commitcount & 1023) == 0) {
+ system("git repack -a -d");
+ }
$state = 1;
} elsif($state == 11 and /^-+$/) {
$state = 1;