From 7ee74a99b2b710b5f5adc22db2fe0aca8a74c809 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 10 Oct 2005 15:14:21 +0200 Subject: [PATCH] svn import: skip initial revisions Add a flag to skip initial revisions: some SVN repositories have initial setup cruft in their logs which we might want to ignore. Signed-Off-By: Matthias Urlichs --- Documentation/git-svnimport.txt | 7 ++++++- git-svnimport.perl | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt index be03a65f81..a144c6c31c 100644 --- a/Documentation/git-svnimport.txt +++ b/Documentation/git-svnimport.txt @@ -12,7 +12,7 @@ SYNOPSIS 'git-svnimport' [ -o ] [ -h ] [ -v ] [ -C ] [ -i ] [ -u ] [ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ] - [ -m ] [ -M regex ] [ ] + [ -s start_chg ] [ -m ] [ -M regex ] [ ] DESCRIPTION @@ -36,6 +36,11 @@ OPTIONS The GIT repository to import to. If the directory doesn't exist, it will be created. Default is the current directory. +-s :: + Start importing at this SVN change number. The default is 1. ++ +When importing incementally, you might need to edit the .git/svn2git file. + -i:: Import-only: don't perform a checkout after importing. This option ensures the working directory and cache remain untouched and will diff --git a/git-svnimport.perl b/git-svnimport.perl index 10ffb5477e..896222ba74 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -31,19 +31,19 @@ die "Need CVN:COre 1.2.1 or better" if $SVN::Core::VERSION lt "1.2.1"; $SIG{'PIPE'}="IGNORE"; $ENV{'TZ'}="UTC"; -our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,$opt_b); +our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,$opt_b,$opt_s); sub usage() { print STDERR < $opt_s and defined $parent) { open(H,"git-rev-parse --verify $parent |"); $rev = ; close(H) or do { @@ -377,7 +377,7 @@ sub commit { return; } $rev = $branches{($parent eq $opt_o) ? "/" : $parent}{"LAST"}; - if($revision != 1 and not $rev) { + if($revision != $opt_s and not $rev) { print STDERR "$revision: do not know ancestor for '$parent'!\n"; return; }