diff --git a/README.txt b/README.txt index c6122c8..3f4b2eb 100644 --- a/README.txt +++ b/README.txt @@ -45,18 +45,26 @@ secretProject.git and evilProject.git, respectively. If the project name of your repository is not the last part of the URL, or you wish to have more control over the final name of the Git repository, you can specify the repository list in tab-delimited format with the first field being -the name to give the Git repository and the second field being the URL of the -Subversion repository: +the URL of the Subversion repository and the second field being the name to +give the Git repository: - awesomeProject svn+ssh://example.org/svn/awesomeProject/repo - evilproject file:///svn/evilProject - notthedroidsyourlookingfor https://example.com/svn/secretProject + svn+ssh://example.org/svn/awesomeProject/repo awesomeProject + file:///svn/evilProject evilproject + https://example.com/svn/secretProject notthedroidsyourlookingfor With this format you can use any name for the final Git repo. In the first example above, we're using the second-to-last part of the URL instead of the last part of the URL. In the second example, we're just changing the name to all lowercase (recommended). And in the final example, move along. Move along. +If your repository is in a standaed (trunk/branches/tags) layout, you may add +--stdlayout as the third field. If you have a non-standard layout, or wish to +pass extra arguments to git-svn on a per-repository basis, you may add them as +subsequent fields: + + http://example.com/svn/standardProject standardProject --stdlayout + http://example.com/svn/weirdWays weird_huh --trunk=head + 2. Create a list of transformations for Subversion usernames to Git committers. Using the repository list created in step 1, run the fetch-svn-authors.sh script diff --git a/git-svn-migrate.sh b/git-svn-migrate.sh index 1fd7a5f..b35ae8d 100755 --- a/git-svn-migrate.sh +++ b/git-svn-migrate.sh @@ -178,11 +178,11 @@ fi while read line do # Check for 2-field format: Name [tab] URL - name=`echo $line | awk '{print $1}'`; - url=`echo $line | awk '{print $2}'`; + url=`echo $line | awk '{print $1}'`; + name=`echo $line | awk '{print $2}'`; + extra_args=`echo $line | awk '{ORS=" "; for (y=3; y<=NF; y++) print $y}'`; # Check for simple 1-field format: URL - if [[ $url == '' ]]; then - url=$name; + if [[ $name == '' ]]; then name=`basename $url`; fi # Process each Subversion URL. @@ -199,7 +199,7 @@ do # Clone the original Subversion repository to a temp repository. cd $pwd; echo "- Cloning repository..." >&2; - git svn clone $url -A $authors_file --authors-prog=$dir/svn-lookup-author.sh --stdlayout --quiet $gitsvn_params $tmp_destination; + git svn clone $url -A $authors_file --authors-prog=$dir/svn-lookup-author.sh --quiet $gitsvn_params $extra_args $tmp_destination; # Create .gitignore file. echo "- Converting svn:ignore properties into a .gitignore file..." >&2;