3

I'm trying to clone an entire TFVC repository hosted in Visual Studio Online with branches using the following command:

git tfs clone --with-branches --export-work-item-mapping="{mapping file path}" https://{project name}.visualstudio.com/DefaultCollection "$/{project}/{branch}"

This has worked for me with several projects thus far, but this past weekend I ran into an issue...

The beginning of the process looks as it did for the other projects, but then after about 3 hours, the console output just keeps repeating the following two lines every 20 minutes or so:

=> Working on TFS branch : $/{source project}/{main branch}
    Fetching from dependent TFS remote '{branch}'...

I let it do this for approximately 40 hours and it just kept doing the same thing.

I re-ran the clone with the --debug option and the last line to get output before it just hangs there looks like this:

get [c4002]$/{project}/{branch}/{file location}/{file name with extension}

There is nothing special about this file that I can see, but looking at changeset 4002, I can see that there was a source rename applied there. I have seen issues reported around renames with git tfs, but they seem to all be resolved according to the github threads.

Has anyone run into this? There is no error output, it just seems to be retrying over and over again...

git tfs version: 0.23.0.0 (TFS client library 12.0.0.0(MS)) (64-bit)

git version 1.9.5.msysgit.1

How 'bout a Fresca
  • 2,267
  • 1
  • 15
  • 26

2 Answers2

1

There is nothing special about this file that I can see, but looking at changeset 4002, I can see that there was a source rename applied there. I have seen issues reported around renames with git tfs, but they seem to all be resolved according to the github threads.

Indeed, I have added rename support in git-tfs but it seems that a scenario (I don't know exactly which one) of rename is not well supported :-(

The bad news is that I don't know how to replicate it and I don't have the time nor the wish to spend time on it (for others because that's such a pain to understand and support TFVC!)

The not so bad news is that you can :

  • either clone after the failing changeset using '-c' option
  • difficult and not tested : quick-clone the failing changeset in another repository, fetch it in the current repository, use 'graft' or 'git replace' and 'filter-branch' to fix the history and continue with 'git tfs fetch'. Hard, boring, long but should work.
Philippe
  • 28,207
  • 6
  • 54
  • 78
1

I confirm that the "difficult and not tested" variant actually is not that difficult and furthermore actually tested.

When the git-tfs hangs, just stop it with Ctrl-C, and move to a new folder and continue clone from the trunk using '-c' option.

When the clone is done, you just have to graft the repos together using the instructions here: How to rebase one Git repository onto another one?

Easy and tested! Over and out!

Community
  • 1
  • 1
xJom
  • 11
  • 1
  • 1
    I did use git-tfs version 0.24.2.0 and git version 2.6.4 (both 64-bit). And I do refer to the second solution proposed by @Philippe – xJom Feb 20 '16 at 17:30