Skip to content

fixes from bcorner13 repo more Debian repo #330

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 13 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: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: ruby
rvm:
- 2.4.1
- jruby
- ruby-head
matrix:
allow_failures:
- rvm: ruby-head
branches:
only:
- develop
48 changes: 39 additions & 9 deletions ChangeLog.markdown → ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,40 @@
* Added the ability to specify the '--branches' and '--tags' arguments multiple times (thanks pdf).
* Fixed a problem with processing of the '--exclude' argument (improper quoting internally) (thanks pdf).

# 2.3.3 - 2016-03-02
This is a bugfix release. It provides fix for git localized messages issue, and also fixes "gc is already running" message.

As git2svn runs git to do it's things (and analyzes it's responses in some points), it is necessary to set LANGUAGE environment variable to "en_US" to fix this kind of error:

Running command: git branch --track "<some_branch_here>" "remotes/svn/<some_branch_here>"
fatal: Не удалось настроить информацию отслеживания; стартовая точка «remotes/svn/<some_branch_here>» не является веткой.
********************************************************************
svn2git warning: Tracking remote SVN branches is deprecated.
In a future release local branches will be created without tracking.
If you must resync your branches, run: svn2git --rebase
********************************************************************
Running command: git checkout "<some_branch_here>"
error: pathspec '<some_branch_here>' did not match any file(s) known to git.
command failed:
git checkout "<some_branch_here>"

Notice localized message of git output. You can fix it with new key `--force-en-us-to-git`.

Also there was changes in git, which triggers `git gc --auto` after some point of modifications to local git repo, so now svn2git modifies `gc.auto` option, sets it to `0` to disable automatic packing of loose objects.
This fixes failing at the end of svn2git script, where it calls `git gc` explicitly:

Running command: git gc
fatal: gc is already running on machine '<machine_name>' pid <pid> (use --force if not)
command failed:
git gc

For me, `gc ---auto` starts just after `fetch`, and while svn2git finishes it's work (really fast) it stays running. When svn2git starts `git gc` explicitly, this new process conflicts with already running process, causing an error message.


# 2.3.2 - 2014-06-08

This is a bugfix release. It fixes issues running with Windows using MRI ruby and fixes a problem with Ruby 1.8.7.

* Removed open4 dependency. svn2git no longer has any runtime dependencies and things work well on Windows again.
* Fixed an issue with Ruby 1.8.7, which doesn't implicitly require the 'thread' library meaning classes that library weren't in scope.

Expand All @@ -23,20 +53,20 @@
issue a "git pull" to fetch the changes. git-svn ceased allowing this in 1.8.3.2, which broke svn2git with that
version of git and all subsequent versions. The rationale seemed to be in order to prevent pushing changes from
git-svn back up and breaking the remote link, but this was never something svn2git supported anyway.

Acknowledging the new reality of upstream, the old behavior is retained but deprecated for users of git < 1.8.3.2.
We'll be removing the establishment of remote tracking SVN branches in the 2.5.0 release. If you wish to sync back
with upstream, run `svn2git --rebase`. If you're on git >= 1.8.3.2 your only option for resynchronizing is to
use `svn2git --rebase`.

Many thanks to ktdreyer for modernizing the test suite and Daniel Ruf (DanielRuf) for pushing on the git compatibility
issue.

* Fixed creating local branches for remote SVN branches in git >= 1.8.3.2.
* Fixed verbose logging of sub-process STDERR stream.
* Added MIT license metadata to gemspec.
* Switched to minitest to get tests working on Ruby 1.9+ with minitest 5+ installed.


# 2.3.0 - 2014-05-14

Expand Down Expand Up @@ -112,7 +142,7 @@

Thanks to Francois Rey (fmjrey), Sven Axelsson (svenax), and Julian Taylor (juliantaylor) for submitting all the patches
that comprise this release. svn2git now works with a much wider array SVN repositories because of their efforts.

* Added --no-minimize-url option for migrating specific subprojects from an SVN repo containing several projects (thanks fmjrey).
* Added --username option for migrating password-protected repositories (thanks svenax).
* Added --revision option for specifying the revision to start importing from (thanks svenax).
Expand Down Expand Up @@ -147,7 +177,7 @@
# 1.3.1 - 2009-06-09

Thanks to KUBO Atsuhiro (iteman) for finding a problem with the tagging process and providing a patch.

* Fixed a problem with creating actual git tags when the SVN tags path was named anything other than 'tags.'

# 1.3.0 - 2009-06-09
Expand Down Expand Up @@ -182,14 +212,14 @@
* Improved docs.

# 1.1.1 - 2009-04-15

* Started using Jeweler for gem management.
* Fixed issue with not loading up RubyGems appropriately.

# 1.1.0 - 2009-01-02

* First release since nirvdrum fork.

* Fixed issues with handling of tags and branches.
* Added better logging of output from git-svn.
* Wrap external command processing to capture failures.
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ubuntu:16.04
RUN apt-get -qq update
RUN apt-get -q -y install git-core git-svn ruby
RUN gem install svn2git
CMD ["svn2git"]
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "minitest"
gem "rake"
gem "jeweler"
76 changes: 68 additions & 8 deletions README.markdown → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,59 @@ Make sure you have git, git-svn, and ruby installed. svn2git is a ruby wrapper

$ sudo apt-get install git-core git-svn ruby

Once you have the necessary software on your system, you can install svn2git through rubygems, which will add the `svn2git` command to your PATH.
Once you have the necessary software on your system, you can install svn2git through rubygems, which will add the `svn2git` command to your PATH.

$ sudo gem install svn2git

Some hints before you start
-----
In Ubuntu 14.04 you have to install latest git and subversion versions to successfully done conversion.
This fixes "error: git-svn died of signal 11" issue.

Upgrade can be done using PPAs:
[https://launchpad.net/~dominik-stadler/+archive/ubuntu/subversion-1.9](https://launchpad.net/~dominik-stadler/+archive/ubuntu/subversion-1.9)
[https://launchpad.net/~git-core/+archive/ubuntu/ppa](https://launchpad.net/~git-core/+archive/ubuntu/ppa)

To add each ppa use commands:

$ sudo add-apt-repository ppa:dominik-stadler/subversion-1.9
$ sudo add-apt-repository ppa:git-core/ppa

or add -E to sudo if you are using proxy to preserve environment variables with proxy information

$ sudo -E add-apt-repository ppa:dominik-stadler/subversion-1.9
$ sudo -E add-apt-repository ppa:git-core/ppa

After that update repository cache and upgrade packages

$ sudo apt-get update
$ sudo apt-get install git-core git-svn subversion

This will upgrade git, git-svn and subversion to latest version (as for 2016-03-02)

Also if you get this kind of error

Running command: git branch --track "<some_branch_here>" "remotes/svn/<some_branch_here>"
fatal: Не удалось настроить информацию отслеживания; стартовая точка «remotes/svn/<some_branch_here>» не является веткой.
********************************************************************
svn2git warning: Tracking remote SVN branches is deprecated.
In a future release local branches will be created without tracking.
If you must resync your branches, run: svn2git --rebase
********************************************************************
Running command: git checkout "<some_branch_here>"
error: pathspec '<some_branch_here>' did not match any file(s) known to git.
command failed:
git checkout "<some_branch_here>"

Notice localized message of git. As svn2git script analyzes git answer here, force English messages from git, using new key `--force-en-us-to-git` (testing feature).
This sets LANGUAGE environment variable to "en_US" for svn2git and its child processes.

Also if you have to provide a password to subversion repository and stuck on

Authentication realm: <http://your_subversion_repository.domain> CollabNet Subversion Repository
Password for '<your_login>':

then try to invoke in console `svn co` first to authorize at subversion repo, it will cache your visit, and then rerun svn2git command.

Usage
-----
Expand Down Expand Up @@ -143,6 +192,16 @@ specified trunk=foo branches=bar and tags=foobar it would be referencing
http://svn.example.com/path/to/repo/foo as your trunk, and so on. However, in
case 4 it references the root of the repo as trunk.

### Tags Notice ###

Notice, that if you want to push tags also to git repo, you need to run not only

git push origin --all

but also

git push origin --tags

### Repository Updates ###

As of svn2git 2.0 there is a new feature to pull in the latest changes from SVN into your
Expand Down Expand Up @@ -202,11 +261,11 @@ Options Reference

$ svn2git --help
Usage: svn2git SVN_URL [options]

Specific options:
--rebase Instead of cloning a new project, rebase an existing one against SVN
--username NAME Username for transports that needs it (http(s), svn)
--password PASS Password for transports that needs it (http(s), svn)
--password PASSWORD Password for transports that needs it (http(s), svn)
--trunk TRUNK_PATH Subpath to trunk from repository URL (default: trunk)
--branches BRANCHES_PATH Subpath to branches from repository URL (default: branches); can be used multiple times
--tags TAGS_PATH Subpath to tags from repository URL (default: tags); can be used multiple times
Expand All @@ -221,7 +280,9 @@ Options Reference
--authors AUTHORS_FILE Path to file containing svn-to-git authors mapping (default: ~/.svn2git/authors)
--exclude REGEX Specify a Perl regular expression to filter paths when fetching; can be used multiple times
-v, --verbose Be verbose in logging -- useful for debugging issues

--rebasebranch REBASEBRANCH Rebase specified branch.
--force-en-us-to-git Force en_US locale to be used by git commands, called by this script.

-h, --help Show this message

FAQ
Expand All @@ -234,9 +295,9 @@ FAQ
Those commits are the first (head) commit of branch in svn that is
associated with that tag. If you want to see all the branches and tags
and their relationships in gitk you can run the following: gitk --all

For further details please refer to FAQ #2.

2. Why don't you reference the parent of the tag commits instead?

In svn you are forced to create what are known in git as annotated tags.
Expand All @@ -246,11 +307,10 @@ FAQ
treated as an annotated tag. Hence, for there to be a true 1-to-1 mapping
between git and svn we have to transfer over the svn commit which acts as
an annotated tag and then tag that commit in git using an annotated tag.

If we were to reference the parent of this svn tagged commit there could
potentially be situations where a developer would checkout a tag in git
and the resulting code base would be different than if they checked out
that very same tag in the original svn repo. This is only due to the fact
that the svn tags allow changesets in them, making them not just annotated
tags.

2 changes: 1 addition & 1 deletion bin/svn2git
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env ruby
#!/usr/bin/ruby

# Copyright (c) 2008 James Coglan
#
Expand Down
Loading