0

Beginner with GIT & SubGit :).

On SVN side (Subversion version 1.7.4), developers created a branch not located under branches folder but at the same level as trunk, tags, branches, i.e.:

- trunk
- branches
- tags
- TheBranch

Then they moved this branch under branches folder (we can see a lot of changes):

- trunk
- branches
  - TheBranch 
- tags

When we are migrating the associated repository into Git using SubGit, the migrated branch contains only the revision associated to the move (ps: no update done after the operation). Nevertheless the number of revisions processed by SubGit is the correct one, but all done in the branch before its move are not displayed.

The command used is:

subgit import --svn-url [svn_url_repository] [path_of_git_repo] --username [user_name] --password [password].

Did we forget an option?

Patrick Quirk
  • 23,334
  • 2
  • 57
  • 88
Didier
  • 11

3 Answers3

1

"subgit import" command is a shortcut for "subgit configure" + "subgit install" + "subgit uninstall", it works for standard trunk/branches/tags repository layout only. In your case I would recommend to use these 3 command instead of single "subgit import":

$ subgit configure --svn-url SVN_URL repo.git

Then edit trunk/branches/tags/shelves options in repo.git/subgit/config to mention your additional branch:

trunk = trunk:refs/heads/master
branches = TheBranch:refs/heads/obsolete/TheBranch
branches = branches/*:refs/heads/*
shelves = shelves/*:refs/shelves/*
tags = tags/*:refs/tags/*

Then translate the repository with

$ subgit install repo.git

If you don't need continuous synchronization run then

$ subgit uninstall repo.git

SubGit needs both source and target branches to be mentioned in subgit/config file to process move.

I'm one of SubGit developers.

Update: fixed an error in the config: there should be the same number of asterisks to the boths sides of ':'.

Dmitry Pavlenko
  • 8,530
  • 3
  • 30
  • 38
0

Thanks for your help.

I successfully executed:

subgit configure --svn-url [svn_url_repository] repo.git

Then updated the config file:

[svn]
trunk = trunk:refs/heads/master
branches = trunk2013:refs/heads/obsolete/*
branches = branches/*:refs/heads/*
shelves = shelves/*:refs/shelves/*
tags = tags/*:refs/tags/*

When I'm executing:

install repo.git
SubGit version 3.1.1 ('Bobique') build #3448
INSTALLATION FAILED
error: Failed to load Subversion configuration at 'repo.git\subgit\config'
error: Invalid layout option 'svn.branches': Number of asterisks ('*') on the left and right side of the mapping definition differs, when it should be equal..

Then after some investigation I replaced:

branches = trunk2013:refs/heads/obsolete/*

by:

branches = trunk2013:refs/heads/obsolete

And now I have the history of TheBranch :).

Thanks again.

Didier
  • 11
-1

Since in older revisions, the branch were not in the 'default' structure folders, it were not migrated to git since the migration basically go over revision by revision and commit each SVN-revision as GIT-commit. In order to solve this you should tell the migration to migrate paths that are not in the default trunk/branches/tags. For more details see the git-svn documentation.

yorammi
  • 6,272
  • 1
  • 28
  • 34