user3759786
user3759786

Reputation:

How to mirror SVN in GIT w/o a trunk

We are using Stash (3.8.0) with the SVN Mirror for Atlassian Stash (2.0.15) plugin, both licensed for 50+ seats. We are trying to mirror SVN to an empty repository in Stash, however. The following keeps us from going.

Our SVN link is svn://svn.hostname.com/. The code lies within the /, not in a branch, trunk or tag. We do not use any of those. When Stash is done importing, we get no error in Stash.

The status page said the following but the repository stays empty.

Subversion Mirror

Does anybody know if this is a possible bug or just a misconfiguration?

Upvotes: 1

Views: 502

Answers (1)

Dmitry Pavlenko
Dmitry Pavlenko

Reputation: 8968

It's a bug in 2.0.15 and misconfiguration. By default SVN mirror plugin assumes you have standard trunk/branches/tags structure, and if there're no such directories, no commits are translated. But if you have different repository structure, you can specify it as well, and since version 2.0.16 (when it is released; 2.0.15 doesn't support that) you can specify project root as the only "branch" of the project.

So the steps are:

  1. Install SVN mirror plugin of version >= 2.0.16 or use this link to 2.0.16-beta3 version (if it not released yet):

http://old.subgit.com/download/stash/stash-svn-importer-2.0.16-beta3.jar

(Choose Administration | Manage add-ons | Upload add-on | From this URL)

  1. Create a repository, choose "Subversion Mirror".
  2. Fill SVN URL, leave Trunk/Branches/Tags/Shelves options as is, you will overwrite them later. Specify other options if you need. Press "Continue".
  3. Choose Advanced Configuration | Apply changes

Edit SVN Mirror plugin for Stash configuration

Edit the config to remove all trunk/branches/tags/shelves options and to add only

trunk = :refs/heads/master

You can find documentation on the options in SubGit book and in comments in this file starting from # character.

:refs/heads/master rule means that SVN path before : character (which is an empty string, that corresponds to the project root) is mapped to Git reference refs/heads/master.

  1. Check authors in "Authors mapping" tab and press "Continue".

That's all, now refs/heads/master Git reference has the history of your project root in Subversion repository.

Upvotes: 1

Related Questions