Skip to content

Commit

Permalink
git-svn: default to repacking every 1000 commits
Browse files Browse the repository at this point in the history
This should reduce disk space usage when doing large imports.
We'll be switching to "gc --auto" post-1.5.4 to handle
repacking for us.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Jan 22, 2008
1 parent 4f5f998 commit 3b839fd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1408,11 +1408,9 @@ sub read_all_remotes {
}

sub init_vars {
if (defined $_repack) {
$_repack = 1000 if ($_repack <= 0);
$_repack_nr = $_repack;
$_repack_flags ||= '-d';
}
$_repack = 1000 unless (defined $_repack && $_repack > 0);
$_repack_nr = $_repack;
$_repack_flags ||= '-d';
}

sub verify_remotes_sanity {
Expand Down Expand Up @@ -2151,7 +2149,7 @@ sub do_git_commit {
0, $self->svm_uuid);
}
print " = $commit ($self->{ref_id})\n";
if (defined $_repack && (--$_repack_nr == 0)) {
if ($_repack && (--$_repack_nr == 0)) {
$_repack_nr = $_repack;
# repack doesn't use any arguments with spaces in them, does it?
print "Running git repack $_repack_flags ...\n";
Expand Down

0 comments on commit 3b839fd

Please sign in to comment.