Skip to contentSkip to conversation

git-svn: unlink internal index files after operations

PATCH In review Eric Wong 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 git-svn: unlink internal index files after operations

Being git, we can generate these very quickly on the fly as needed, so there's no point in wasting space for these things for large projects.

---
 git-svn.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
git-svn.perl +3 -0
index 54d7844..fde39e2 100755
@@ -396,6 +396,7 @@ sub cmd_set_tree {
 	}
 	$gs->set_tree($_) foreach @revs;
 	print "Done committing ",scalar @revs," revisions to SVN\n";
+	unlink $gs->{index};
 }
 
 sub cmd_dcommit {
@@ -514,6 +515,7 @@ sub cmd_dcommit {
 			$last_rev = $cmt_rev;
 		}
 	}
+	unlink $gs->{index};
 }
 
 sub cmd_find_rev {
@@ -1374,6 +1376,7 @@ sub fetch_all {
 
 	($base, $head) = parse_revision_argument($base, $head);
 	$ra->gs_fetch_loop_common($base, $head, \@gs, \@globs);
+	unlink $_->{index} foreach @gs;
 }
 
 sub read_all_remotes {
Signature · 1 line
Eric Wong
#1 lore raw
Quoted 3 lines · Eric Wong

Being git, we can generate these very quickly on the fly as needed, so there's no point in wasting space for these things for large projects.

Excellent!

For existing repos, I assume the correct thing to do is to just blast all the existing index files manually?

Signature · 2 lines
Karl Hasselström, [email protected]
      www.treskal.com/kalle
author
#2 lore raw
Quoted 10 lines · Karl Hasselström
Quoted 3 lines · Eric Wong

Being git, we can generate these very quickly on the fly as needed, so there's no point in wasting space for these things for large projects.

Excellent!

For existing repos, I assume the correct thing to do is to just blast all the existing index files manually?

Yes. index files inside $GIT_DIR/svn have always been safely deletable (except while a git-svn is actually running :).

I'll probably work on an automated full migration strategy at some point (handling rev_db => rev_map, mainly) when I have time.

Signature · 1 line
Eric Wong