Migrate history and branches of a repository that did not have branches from the beginning

142 views
Skip to first unread message

magnuso...@gmail.com

unread,
Jan 23, 2019, 5:50:00 AM1/23/19
to git-tfs-dev
The TFSC collection I want to migrate to GIT had from the beginning no branches at all. All source code was stored directly under $/Gateway

A few years ago we took the step to restructuring the code to enable branches, and the code structure now looks like this:
 $/Gateway/Client/Main [*]                                                                                                                                  
 |                                                                                                                                                          
 +- $/Gateway/Client/Test                                                                                                                                   
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/Martina                                                                                                                         
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/OpcUa                                                                                                                           
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Gustaf                                                                                                                             
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/LabView                                                                                                                            
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Ny kommunikation                                                                                                                   
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/Ny kommunikation-branch/Martina                                                                                                 
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Test                                                                                                                               

Now the question is how I should do so that I can migrate all history while all the branches (or at least the main branch) remains in the migration.

I tried to make a migration from $/Gateway/Client/Main, but then I didn't get the history from the time before the restructuring of the code. In addition, I received the following warning message a lot of times:
warning: this changeset XXX is a merge changeet. But gt-tfs failed to find and fetch the parent change code XXX. Parent changeset will be ignored.


The next attempt was to make a migration direct from $/Gateway, but then I got no branches. The directories that are for different branches end up in the main branch. In addition, I received the following message multiple times:
info: this changeset XXX is a merge changeet. But was not treated as is because of your setting ...

So, is there anything I can do so that I can migrate all branches (or just the main branch) and at the same time get the history before the restructuring? Is this scenario supported, or is it something I can do in the code to support this?

Philippe Miossec

unread,
Jan 23, 2019, 1:00:44 PM1/23/19
to git-t...@googlegroups.com

The TFSC collection I want to migrate to GIT had from the beginning no branches at all. All source code was stored directly under $/Gateway

A few years ago we took the step to restructuring the code to enable branches, and the code structure now looks like this:
 $/Gateway/Client/Main [*]                                                                                                                                  
 |                                                                                                                                                          
 +- $/Gateway/Client/Test                                                                                                                                   
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/Martina                                                                                                                         
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/OpcUa                                                                                                                           
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Gustaf                                                                                                                             
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/LabView                                                                                                                            
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Ny kommunikation                                                                                                                   
 |  |                                                                                                                                                       
 |  +- $/Gateway/Client/Dev/Ny kommunikation-branch/Martina                                                                                                 
 |                                                                                                                                                          
 +- $/Gateway/Client/Dev/Test                                                                                                                               

Now the question is how I should do so that I can migrate all history while all the branches (or at least the main branch) remains in the migration.

I tried to make a migration from $/Gateway/Client/Main, but then I didn't get the history from the time before the restructuring of the code. In addition, I received the following warning message a lot of times:
warning: this changeset XXX is a merge changeet. But gt-tfs failed to find and fetch the parent change code XXX. Parent changeset will be ignored.


Unfortunately, you end up in an unsupported case :-(

I know the case you described but I don't even know if it's something that could be handled by git-tfs or if that's a limitation of TFVC... 



The next attempt was to make a migration direct from $/Gateway, but then I got no branches. The directories that are for different branches end up in the main branch. In addition, I received the following message multiple times:
info: this changeset XXX is a merge changeet. But was not treated as is because of your setting ...

So, is there anything I can do so that I can migrate all branches (or just the main branch) and at the same time get the history before the restructuring? Is this scenario supported, or is it something I can do in the code to support this?

So, you should have understood that, no, that's not supported. 

But what you did is a good step towards your goal and once  you get the 2 histories in 2 git repositories, you could import the history of one in the other and then use 'git replace --graft' to link the 2 histories. 

And do a 'git filter-branch' to make it definitive. 
Reply all
Reply to author
Forward
0 new messages