Re: [PATCH] cvsimport: introduce -L<imit> option to workaround memory leaks
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- May 23, 2006, 02:28 UTC
- Message-ID
- <Pine.LNX.4.64.0605221926270.3697@g5.osdl.org>
- In-Reply-To
- <11482978883713-git-send-email-martin@catalyst.net.nz>
This stupid patch on top of yours seems to make git happier. It's disgusting, I know, but it just repacks things every kilo-commit.
I actually think that I found a real ext3 performance bug from trying to determine why git sometimes slows down ridiculously when the tree has been allowed to go too long without a repack.
Linus
---
diff --git a/git-cvsimport.perl b/git-cvsimport.perl index fb56278..c141f5e 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -853,10 +853,14 @@ # VERSION:1.96->1.96.2.1 } 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;