0

Is there any tool that supports so called "id mentions" when cloning a TFVC repository into a Git repository? What I would like is for each commit in the cloned Git repository to contain id mentions for its linked work items.

Commit: hash... Message: A cloned commit, Related work item(s): #123456

So far I have tried git-tf (Microsoft) and git-tfs, and in a way they both keep the changeset history intact but not via ID mentions, instead they add a tag for each commit to the TFS changeset. I could then go into TFS web portal and look up the changeset, where all the work items will be visible, but this information would not be available directly inside Visual Studio.

Since Visual Studio 2015 update 1(?), it is possible to associate a commit with a work item via id-mentions. This functionality is well integrated into Visual Studio and the work item linking is very much like it used to work in TFVC. Also, when looking at the history in Visual Studio for a TFS Git repository, the related work items are shown if there is an ID mention in the current commit.

Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
Emil G
  • 1,211
  • 1
  • 14
  • 26

1 Answers1

1

Not sure because I don't remember what I have coded, but it should works with git-tfs and the '--export' option...

Philippe
  • 28,207
  • 6
  • 54
  • 78
  • Hi! Thanks for the reply. I tried using git-tfs with the --export option and the result is that in the end each commit contains a section:git-tfs-id: http...my-tfs-server/tfs$/MyTfs/Path;C41234. This id is the tfs-changeset id, and can be looked up eg in the source control explorer, however it is not what I am after. I would like all linked work items to be present as id-mentions in the commit message. This will make Visual Studio pick up the connection between commit and work items in the history, which is what I want. – Emil G Sep 16 '16 at 07:05
  • I tried to find the relevant part of the commit message generating functionality in the GitHub repository but were unable to do so. Can you point me in the right direction som maybe I can implement this feature? – Emil G Oct 03 '16 at 06:23
  • Method 'ProcessChangeset' in 'GitTfsRemote.cs' file. But, like I told you, I see that it's already done! – Philippe Oct 03 '16 at 06:58
  • Yeas, I can see the code now, should work like you said. I'll investigate why it doesn't appear in my cloned commits message(s). Thanks for the help. – Emil G Oct 03 '16 at 08:53
  • Phillipe: I've now tried with another repo and like you said, export will do id-mention when --export option is used. I must have looked at commits that did not have any work item link. Thank you for the help. Git-tfs with --export will do the job! – Emil G Oct 21 '16 at 08:54