Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reordered fields of list of Subversion repositories #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions git-svn-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down