git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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;
Previous: Martin LanghoffNext: Martin Langhoff (CatalystIT)
Message 2 of 10 in “cvsimport: introduce -L<imit> option to workaround memory leaks”
  1. cvsimport: introduce -L<imit> option to workaround memory leaksMartin Langhoff, May 22, 2006
  2. Linus TorvaldsMay 23, 2006
  3. Martin Langhoff (CatalystIT)May 23, 2006
  4. Theodore TsoMay 23, 2006
  5. Linus TorvaldsMay 23, 2006
  6. Linus TorvaldsMay 23, 2006
  7. Martin LanghoffMay 26, 2006
  8. Linus TorvaldsMay 26, 2006
  9. Jakub NarebskiMay 26, 2006
  10. Martin LanghoffMay 26, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.