From eaf718f3ece277462de4e47391e5a965bbbaa297 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 10 Oct 2005 11:40:43 +0200 Subject: New: git-svnimport. As the name suggests, this script imports from SVN. Only "normal" SVN repositories (with single trunk/, branches/, and tags/ subdrectories) are supported. Incremental imports require preserving the file .git/svn2git. Signed-Off-by: Matthias Urlichs --- Documentation/git-svnimport.txt | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/git-svnimport.txt (limited to 'Documentation') diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt new file mode 100644 index 000000000..be03a65f8 --- /dev/null +++ b/Documentation/git-svnimport.txt @@ -0,0 +1,99 @@ +git-svnimport(1) +================ +v0.1, July 2005 + +NAME +---- +git-svnimport - Import a SVN repository into git + + +SYNOPSIS +-------- +'git-svnimport' [ -o ] [ -h ] [ -v ] + [ -C ] [ -i ] [ -u ] + [ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ] + [ -m ] [ -M regex ] [ ] + + +DESCRIPTION +----------- +Imports a SVN repository into git. It will either create a new +repository, or incrementally import into an existing one. + +SVN access is done by the SVN:: Perl module. + +git-svnimport assumes that SVN repositories are organized into one +"trunk" directory where the main development happens, "branch/FOO" +directories for branches, and "/tags/FOO" directories for tags. +Other subdirectories are ignored. + +git-svnimport creates a file ".git/svn2git", which is required for +incremental SVN imports. + +OPTIONS +------- +-C :: + The GIT repository to import to. If the directory doesn't + exist, it will be created. Default is the current directory. + +-i:: + Import-only: don't perform a checkout after importing. This option + ensures the working directory and cache remain untouched and will + not create them if they do not exist. + +-t :: + Name the SVN trunk. Default "trunk". + +-T :: + Name the SVN subdirectory for tags. Default "tags". + +-b :: + Name the SVN subdirectory for branches. Default "branches". + +-o :: + The 'trunk' branch from SVN is imported to the 'origin' branch within + the git repository. Use this option if you want to import into a + different branch. + +-m:: + Attempt to detect merges based on the commit message. This option + will enable default regexes that try to capture the name source + branch name from the commit message. + +-M :: + Attempt to detect merges based on the commit message with a custom + regex. It can be used with -m to also see the default regexes. + You must escape forward slashes. + +-v:: + Verbosity: let 'svnimport' report what it is doing. + +:: + The URL of the SVN module you want to import. For local + repositories, use "file:///absolute/path". + +-h:: + Print a short usage message and exit. + +OUTPUT +------ +If '-v' is specified, the script reports what it is doing. + +Otherwise, success is indicated the Unix way, i.e. by simply exiting with +a zero exit status. + +Author +------ +Written by Matthias Urlichs , with help from +various participants of the git-list . + +Based on a cvs2git script by the same author. + +Documentation +-------------- +Documentation by Matthias Urlichs . + +GIT +--- +Part of the gitlink:git[7] suite + -- cgit v1.2.1 From 7ee74a99b2b710b5f5adc22db2fe0aca8a74c809 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 10 Oct 2005 15:14:21 +0200 Subject: 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 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt index be03a65f8..a144c6c31 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 -- cgit v1.2.1 From 3ef378a67b5b39441837700ab4dfb800eb443c5a Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 10 Oct 2005 18:45:00 +0200 Subject: svn import: Add a loop limit option The svn library has a serious memory leak. Added a new option (-l NUM) which causes git-svnimport to exit cleanly after fetching that many changes, in order to . Signed-Off-By: Matthias Urlichs --- Documentation/git-svnimport.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Documentation') diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt index a144c6c31..047f8f334 100644 --- a/Documentation/git-svnimport.txt +++ b/Documentation/git-svnimport.txt @@ -10,7 +10,7 @@ git-svnimport - Import a SVN repository into git SYNOPSIS -------- 'git-svnimport' [ -o ] [ -h ] [ -v ] - [ -C ] [ -i ] [ -u ] + [ -C ] [ -i ] [ -u ] [-l limit_nr_changes] [ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ] [ -s start_chg ] [ -m ] [ -M regex ] [ ] @@ -70,6 +70,15 @@ When importing incementally, you might need to edit the .git/svn2git file. regex. It can be used with -m to also see the default regexes. You must escape forward slashes. +-l :: + Limit the number of SVN changesets we pull before quitting. + This option is necessary because the SVN library has serious memory + leaks; the recommended value for nontrivial imports is 100. + + git-svnimport will still exit with a zero exit code. You can check + the size of the file ".git/svn2git" to determine whether to call + the importer again. + -v:: Verbosity: let 'svnimport' report what it is doing. -- cgit v1.2.1 From 25f6f325d7a8f7cb686a9ffd9fa2c00b3aa85a60 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Tue, 11 Oct 2005 18:13:30 +0200 Subject: svn import: Add direct HTTP access Some SVN repositories that are accessible through HTTP don't like when I retrieve files using SVN methods ("internal server error"). Therefore, I added an option to get the contents using (persistent) HTTP directly. This also reduces round-trip time, from two or three requests down to one. Also corrected error handling a bit. Signed-Off-By: Matthias Urlichs --- Documentation/git-svnimport.txt | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt index 047f8f334..a27a83596 100644 --- a/Documentation/git-svnimport.txt +++ b/Documentation/git-svnimport.txt @@ -9,10 +9,11 @@ git-svnimport - Import a SVN repository into git SYNOPSIS -------- -'git-svnimport' [ -o ] [ -h ] [ -v ] +'git-svnimport' [ -o ] [ -h ] [ -v ] [ -d | -D ] [ -C ] [ -i ] [ -u ] [-l limit_nr_changes] [ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ] - [ -s start_chg ] [ -m ] [ -M regex ] [ ] + [ -s start_chg ] [ -m ] [ -M regex ] + [ ] DESCRIPTION @@ -82,9 +83,32 @@ When importing incementally, you might need to edit the .git/svn2git file. -v:: Verbosity: let 'svnimport' report what it is doing. +-d:: + Use direct HTTP requests if possible. The "" argument is used + only for retrieving the SVN logs; the path to the contents is + included in the SVN log. + +-D:: + Use direct HTTP requests if possible. The "" argument is used + for retrieving the logs, as well as for the contents. ++ +There's no safe way to automatically find out which of these options to +use, so you need to try both. Usually, the one that's wrong will die +with a 40x error pretty quickly. + :: The URL of the SVN module you want to import. For local repositories, use "file:///absolute/path". ++ +If you're using the "-d" or "-D" option, this is the URL of the SVN +repository itself; it usually ends in "/svn". + +:: + The URL of the SVN module you want to import. For local + repositories, use "file:///absolute/path". + + + The path to the module you want to check out. -h:: Print a short usage message and exit. -- cgit v1.2.1