Skip to content

Making it run on Windows #18

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

Open
wants to merge 2 commits 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
11 changes: 0 additions & 11 deletions CHANGELOG.txt

This file was deleted.

5 changes: 5 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
ABOUT git-svn-migrate
---------------------

This fork is basically th same as the original script by JOhn Albin.
The only real difference is tha tthe original broke when run in MINGW/Git BASH on WIndows.
This version includes some minor tweaks, that'll make it work flawlessly on Windows.
The arguments and procedure are all the same as the original script.

The git-svn-migrate project is a set of helper scripts to ease the migration of
Subversion repositories to Git.

Expand Down
3 changes: 2 additions & 1 deletion fetch-svn-authors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ fi

# Process each URL in the repository list.
tmp_file="tmp-authors-transform.txt";
touch $tmp_file;
while read line
do
# Check for 2-field format: Name [tab] URL
Expand All @@ -147,4 +148,4 @@ else
# Output to the specified destination file.
cat $tmp_file | sort -u > $destination;
fi
unlink $tmp_file;
rm $tmp_file;
20 changes: 11 additions & 9 deletions git-svn-migrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ fi
# Process each URL in the repository list.
pwd=`pwd`;
tmp_destination="$pwd/tmp-git-repo";
mkdir -p $destination;
mkdir -p "$destination";
destination=`cd $destination; pwd`; #Absolute path.

# Ensure temporary repository location is empty.
if [[ -e $tmp_destination ]]; then
echo "Temporary repository location \"$tmp_destination\" already exists. Exiting." >&2;
exit 1;
fi
mkdir -p "$tmp_destination";
while read line
do
# Check for 2-field format: Name [tab] URL
Expand All @@ -191,38 +192,39 @@ do
echo "Processing \"$name\" repository at $url..." >&2;

# Init the final bare repository.
mkdir $destination/$name.git;
cd $destination/$name.git;
mkdir "$destination/$name.git";
cd "$destination/$name.git";
git init --bare $gitinit_params;
git symbolic-ref HEAD refs/heads/trunk;

# 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;
echo "$pwd/$authors_file";
git svn clone $url -A "$pwd/$authors_file" --authors-prog="$dir/svn-lookup-author.sh" --stdlayout --quiet $gitsvn_params "$tmp_destination";

# Create .gitignore file.
echo "- Converting svn:ignore properties into a .gitignore file..." >&2;
if [[ $ignore_file != '' ]]; then
cp $ignore_file $tmp_destination/.gitignore;
cp "$ignore_file" "$tmp_destination/.gitignore";
fi
cd $tmp_destination;
cd "$tmp_destination";
git svn show-ignore --id trunk >> .gitignore;
git add .gitignore;
git commit --author="git-svn-migrate <[email protected]>" -m 'Convert svn:ignore properties to .gitignore.';

# Push to final bare repository and remove temp repository.
echo "- Pushing to new bare repository..." >&2;
git remote add bare $destination/$name.git;
git remote add bare "$destination/$name.git";
git config remote.bare.push 'refs/remotes/*:refs/heads/*';
git push bare;
# Push the .gitignore commit that resides on master.
git push bare master:trunk;
cd $pwd;
rm -r $tmp_destination;
rm -r "$tmp_destination";

# Rename Subversion's "trunk" branch to Git's standard "master" branch.
cd $destination/$name.git;
cd "$destination/$name.git";
git branch -m trunk master;

# Remove bogus branches of the form "name@REV".
Expand Down