Skip to content

Commit

Permalink
Merge branch 'svn' of http://netz.smurf.noris.de/git/git
Browse files Browse the repository at this point in the history
[jc: I have my pre-commit hook enabled to catch trailing whitespaces,
 and fixed them up while merging.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Oct 16, 2005
2 parents 6abf5c0 + 40dad96 commit 2950411
Show file tree
Hide file tree
Showing 5 changed files with 859 additions and 5 deletions.
137 changes: 137 additions & 0 deletions Documentation/git-svnimport.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
git-svnimport(1)
================
v0.1, July 2005

NAME
----
git-svnimport - Import a SVN repository into git


SYNOPSIS
--------
'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]
[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_nr_changes]
[ -b branch_subdir ] [ -t trunk_subdir ] [ -T tag_subdir ]
[ -s start_chg ] [ -m ] [ -M regex ]
<SVN_repository_URL> [ <path> ]


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 <target-dir>::
The GIT repository to import to. If the directory doesn't
exist, it will be created. Default is the current directory.

-s <start_rev>::
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
not create them if they do not exist.

-t <trunk_subdir>::
Name the SVN trunk. Default "trunk".

-T <tag_subdir>::
Name the SVN subdirectory for tags. Default "tags".

-b <branch_subdir>::
Name the SVN subdirectory for branches. Default "branches".

-o <branch-for-HEAD>::
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 <regex>::
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.

-l <max_num_changes>::
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.

-d::
Use direct HTTP requests if possible. The "<path>" 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 "<path>" 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.

<SVN_repository_URL>::
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".

<SVN_repository_URL>::
The URL of the SVN module you want to import. For local
repositories, use "file:///absolute/path".

<path>
The path to the module you want to check out.

-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 <smurf@smurf.noris.de>, with help from
various participants of the git-list <git@vger.kernel.org>.

Based on a cvs2git script by the same author.

Documentation
--------------
Documentation by Matthias Urlichs <smurf@smurf.noris.de>.

GIT
---
Part of the gitlink:git[7] suite

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SCRIPT_SH = \
SCRIPT_PERL = \
git-archimport.perl git-cvsimport.perl git-relink.perl \
git-rename.perl git-shortlog.perl git-fmt-merge-msg.perl \
git-findtags.perl
git-findtags.perl git-svnimport.perl

SCRIPT_PYTHON = \
git-merge-recursive.py
Expand Down
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Standards-Version: 3.6.1
Package: git-core
Architecture: any
Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, patch, rcs
Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl, python (>= 2.4.0), less
Recommends: rsync, curl, ssh, libmail-sendmail-perl, libemail-valid-perl, libsvn-core-perl (>= 1.2.1), python (>= 2.4.0), less
Suggests: cogito
Conflicts: git, cogito (<< 0.13)
Description: The git content addressable filesystem
Expand Down
6 changes: 3 additions & 3 deletions git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ ($$)
unless($pid) {
$pr->writer();
$pw->reader();
open(OUT,">&STDOUT");
dup2($pw->fileno(),0);
dup2($pr->fileno(),1);
$pr->close();
Expand All @@ -587,10 +588,9 @@ ($$)
if ( -e "$git_dir/refs/heads/$mparent") {
$mparent = get_headref($mparent, $git_dir);
push @par, '-p', $mparent;
# printing here breaks import #
# # print "Merge parent branch: $mparent\n" if $opt_v;
print OUT "Merge parent branch: $mparent\n" if $opt_v;
}
}
}
}

exec("env",
Expand Down
Loading

0 comments on commit 2950411

Please sign in to comment.