{"thread":{"id":"11855","subject":"[PATCH 1/2] git-svn: Don't call git-repack anymore","startedAt":"2008-02-03T16:55:51Z","lastAt":"2008-02-03T16:56:18Z","messageCount":3,"participants":["Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"67225","messageId":"20080203165234.10816.6061.stgit@yoghurt","threadId":"11855","inReplyTo":"20080121224818.GA8872@untitled","subject":"[PATCH 0/2] \"git svn\" and \"git gc --auto\"","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-02-03T16:55:51Z","receivedAt":"2008-02-03T16:55:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-01-21 14:48:28 -0800, Eric Wong wrote:\n\n> Sorry for the latency[1], ack on both of Karl's patches for\n> post-1.5.4.\n\nSo here they are again. There was a trivial merge conflict with Eric's\nfix, but otherwise they are unchanged.\n\n---\n\nKarl Hasselström (2):\n      Let \"git svn\" run \"git gc --auto\" occasionally\n      git-svn: Don't call git-repack anymore\n\n\n git-svn.perl |   24 ++++++++++++++----------\n 1 files changed, 14 insertions(+), 10 deletions(-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"67223","messageId":"20080203165612.10816.35458.stgit@yoghurt","threadId":"11855","inReplyTo":"20080203165234.10816.6061.stgit@yoghurt","subject":"[PATCH 1/2] git-svn: Don't call git-repack anymore","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-02-03T16:56:12Z","receivedAt":"2008-02-03T16:56:12Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"In a moment, we'll start calling git-gc --auto instead, since it is a\nbetter fit to what we're trying to accomplish.\n\nThe command line options are still accepted, but don't have any\neffect, and we warn the user about that.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n git-svn.perl |   14 +++-----------\n 1 files changed, 3 insertions(+), 11 deletions(-)\n\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 75e97cc..074068c 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1247,7 +1247,6 @@ use File::Path qw/mkpath/;\n use File::Copy qw/copy/;\n use IPC::Open3;\n \n-my $_repack_nr;\n # properties that we do not log:\n my %SKIP_PROP;\n BEGIN {\n@@ -1408,9 +1407,9 @@ sub read_all_remotes {\n }\n \n sub init_vars {\n-\t$_repack = 1000 unless (defined $_repack && $_repack > 0);\n-\t$_repack_nr = $_repack;\n-\t$_repack_flags ||= '-d';\n+\tif (defined $_repack || defined $_repack_flags) {\n+\t       warn \"Repack options are obsolete; they have no effect.\\n\";\n+\t}\n }\n \n sub verify_remotes_sanity {\n@@ -2149,13 +2148,6 @@ sub do_git_commit {\n \t\t                   0, $self->svm_uuid);\n \t}\n \tprint \" = $commit ($self->{ref_id})\\n\";\n-\tif ($_repack && (--$_repack_nr == 0)) {\n-\t\t$_repack_nr = $_repack;\n-\t\t# repack doesn't use any arguments with spaces in them, does it?\n-\t\tprint \"Running git repack $_repack_flags ...\\n\";\n-\t\tcommand_noisy('repack', split(/\\s+/, $_repack_flags));\n-\t\tprint \"Done repacking\\n\";\n-\t}\n \treturn $commit;\n }\n \n"},{"id":"67224","messageId":"20080203165618.10816.6757.stgit@yoghurt","threadId":"11855","inReplyTo":"20080203165234.10816.6061.stgit@yoghurt","subject":"[PATCH 2/2] Let \"git svn\" run \"git gc --auto\" occasionally","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-02-03T16:56:18Z","receivedAt":"2008-02-03T16:56:18Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Let \"git svn\" run \"git gc --auto\" every 1000 imported commits to\nreduce the number of loose objects.\n\nTo handle the common use case of frequent imports, where each\ninvocation typically fetches much less than 1000 commits, also run gc\nunconditionally at the end of the import.\n\n\"1000\" is the same number that was used by default when we called\ngit-repack. It isn't necessarily still the best choice.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n git-svn.perl |   12 ++++++++++++\n 1 files changed, 12 insertions(+), 0 deletions(-)\n\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 074068c..6cc3157 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1247,6 +1247,8 @@ use File::Path qw/mkpath/;\n use File::Copy qw/copy/;\n use IPC::Open3;\n \n+my ($_gc_nr, $_gc_period);\n+\n # properties that we do not log:\n my %SKIP_PROP;\n BEGIN {\n@@ -1407,6 +1409,7 @@ sub read_all_remotes {\n }\n \n sub init_vars {\n+\t$_gc_nr = $_gc_period = 1000;\n \tif (defined $_repack || defined $_repack_flags) {\n \t       warn \"Repack options are obsolete; they have no effect.\\n\";\n \t}\n@@ -2095,6 +2098,10 @@ sub restore_commit_header_env {\n \t}\n }\n \n+sub gc {\n+\tcommand_noisy('gc', '--auto');\n+};\n+\n sub do_git_commit {\n \tmy ($self, $log_entry) = @_;\n \tmy $lr = $self->last_rev;\n@@ -2148,6 +2155,10 @@ sub do_git_commit {\n \t\t                   0, $self->svm_uuid);\n \t}\n \tprint \" = $commit ($self->{ref_id})\\n\";\n+\tif (--$_gc_nr == 0) {\n+\t\t$_gc_nr = $_gc_period;\n+\t\tgc();\n+\t}\n \treturn $commit;\n }\n \n@@ -3975,6 +3986,7 @@ sub gs_fetch_loop_common {\n \t\t$max += $inc;\n \t\t$max = $head if ($max > $head);\n \t}\n+\tGit::SVN::gc();\n }\n \n sub match_globs {\n"}]}