Commit message not showing up after commit - tfs

I have a little issue with the commit messages not showing up after a commit is done. It only shows if i associated a work item in our TFS.
The output in VS code shows this when i add a associated work item from the TFS, comment and commit:
tf checkin -noprompt -collection:https://domain ********
/Users/Repos/Main/Frontend/grid.jade -comment: #148 - test commit message -associate:148
Changeset 140 checked in.
While this is how a commit looks in the output when i don´t associate a work item:
tf checkin -noprompt -collection:https://domain ********
/Users/Repos/Main/Frontend/grid.jade
Changeset 141 checked in.
The commit comment is gone. If anyone got an fix for this i would appreciate it :-)
Commit comments are quite important to have in relation to a commit, and i don´t want to associate every minor commit to a work item in TFS.
My specs:
HW: Mac OSX - 10.12.6
SW: Visual Studio Code - 1.16.1
We use Visual Studio Team Services (TFS)

I can reproduce this issue, cannot submit the comment with changeset. Seems there's something wrong with the Visual Studio Team Services Extension for Visual Studio Code or Visual Studio Code itself.
I have submitted a feedback for you, please track it here : https://developercommunity.visualstudio.com/content/problem/123402/vscode-comments-cannot-be-submitted-with-changeset.html
For now, as a workaround, you can use the Visual Studio with Team explorer to check in the changes with comment.
Or, directly check in with tf checkin command:
tf checkin -noprompt -comment:"test commit message"

Related

How to enable git on existing TFS project?

Environment: Visual Studio 2017, TFS project set at visual studio online.
I am working on a community project. The source code is checked into TFS project using the free account provided by visual studio online.
I now need to enable git on this project such that others can use from other projects.
On TFS online, I see a way to create a new GIT-based project but I don't see any option to enable GIT on an existing TFS project. I remember to have used this option long time ago. Wondering where I can find this switch. Or, is there any easy way to migrate existing code to GIT. Regards.
You can use Import repository to import the Git repository from TFVC.
From the repo drop-down, select Import repository.
Select TFVC from the Source type dropdown
Type the path to the repository / branch / folder that you want to
import to the Git repository. For example,
$/0522TFVCScrum/BuildProcessTemplates
If you want to migrate history from the TFVC repository, click
Migrate history and select the number of days. You can migrate up to
180 days of history starting from the most recent changeset. A link
to the TFVC repository is added in the commit message of the 1st
changeset that is migrated to Git. This makes it easy to find older
history when needed.
Give a name to the new Git repository and click Import. Depending on
the size of the import, your Git repository would be ready in a few
minutes.
Refer to this article for details: Import repositories from TFVC to Git
Hover over the Code tab, click "Manage Repositories", then click the "New Repository" button.

tfpt.exe on Visual Studio 2017

Even after installing Productivity Power Tools extension for Visual Studio 2017 I still cannot run tfpt.exe to execute the command suggested on this post:
C:\Development> tfpt unshelve "ShevesetName;UserName" /migrate /source:"$/Project/Source" /target:"$/Project/Target"
Where can I find this program?
The Productivity Power Tools are not the same thing as the TFS Power Tools, so that's why installing it didn't help.
There is no set of TFS 2017 Power Tools. From the TFS 2017 release notes:
Issue: No Power Tools have been released for TFS 2017.
Workaround: We are excited to let you know that most of the previous
Power Tools have been integrated into TFS 2017. The Process Template
Editor is one that has not been integrated, but we are going to
publish a Process Template Editor tool for TFS 2017 to the Visual
Studio Gallery shortly after TFS 2017 is available. We will provide
the link here as soon as it’s published
Just as Daniel said, they are two entirely different things. A supplement :TFS 2017 Process Template Editor is available
In your case, you are trying to use the unshelve command to unshelve a shelveset to another branch in TFS. As a workaround you could use tf Unshelve and Rename command to achieve this in two steps.
Or just install a earlier version VS and Power Tools such as VS2015 and Microsoft Visual Studio Team Foundation Server 2015 Power Tools. After all you just need to match the version of the TFS Power Tools with your Visual Studio client.
Possible workaround, which helped me!
Create a new workspace and do not download all the files.
Unshelve your changes to this new workspace, which would result in having only the modified files from your current branch.
Compare and manually merge your changes into the other branch.
You can use this VisualStudio extension witch does exacly what you want:
MultiMerge - https://marketplace.visualstudio.com/items?itemName=Jesusfan.MultiMerge2022
This extension allow you to unshelve to other branch.
You can use git-tfs to accomplish this. The steps you should perform are (after git and git-tfs have been installed):
create a git branch from the shelveset (git_branch_a).
initialize a git branch (git_branch_b) based on the TFS target branch (tfs_branch_b).
merge the git_branch_a into git_branch_b.
based on the git_branch_b create a shelveset.
the new shelveset can now be unshelved in the tfs_branch_b.

Visual Studio 2015 - Check in to a different branch in TFS

I checked out some files from the main branch of our code set in TFS. Later, a separate branch was created. I would like to check in my code to the new branch, even though I originally checked it out of the original one. Is this possible?
EDIT: I know I can check in to the main branch and do a merge, but I'd like to avoid that if possible.
Well, it's based on which version control you are using.
If you are using GIT, it's simple. After you created the new branch in the UI, you just need to do a 'check out' of the new branch. Any uncommitted changes will be automatically point to the new branch. You can then commit them there.
If you are using TFVC, you need to shelve your changes on the original branch and unshelve them on the other branch. This functionality is provided using tfpt unshelve /migrate command. More detail steps please refer the question: TFS: submit changes done locally in one branch to another branch
It's also a sample which shows the difference between GIT and TFVC.
Install TFS 2015 Power Tools
Create a shelveset of your changes
Open the Developer Command Prompt
Use the tfpt unshelve /migrate command as such
tfpt unshelve /migrate /source:$/Project/Branch1 /target:$/Project/Branch2
I couldn't do with the answers using Power Tools, so I checked in on the source branch, merged to target, and rolled back from source branch.

unshelving team explorer everywhere

I'm trying to unshelve a shelveset using the command line with team explorer everywhere. I keep receiving this error:
An error occurred: TF400016: Unshelve with Merge is not supported on the version of Team Foundation Server on which your team project is hosted.
The shelveset is on the same branch as the one I'm trying to unshelve onto. I've run tf undo -recursive . before trying to unshelve and it tells me there are no pending changes, so I'm unsure why it is trying to merge. Has anyone had any success with this? Thanks for the help.
Has the file changed in tfs since the shelve set was created? I have seen the same problem if you try to unshelve a set from previous version of the file over a subsequent version. To resolve, you can pull the code that matches the shelve set, then unshelve, then get the latest code and the merge will happen correctly.

using team foundation power tools tfpt "an item with the same key has already been added"

We are using TFS 2012
I downloaded the TFS Power Tools for vs.net 2013
I am running on windows 7 64bit
I have changed directory into the source branch. Executed the following
tfpt unshelve shelfsetname /migrate /source:$/path1/v1 /target:$/path1/v2
I continually get error
An item with the same key has already been added
I have tried many options, including checking out the shelfset, shelving the set again while not keeping any local changes etc.
I have removed cache files from paths
C:\Users{user}\AppData\Local\Microsoft\Team Foundation\4.0\Cache and
C:\Users{user}\AppData\Local\Microsoft\Team Foundation\5.0\Cache
Any ideas i am at wits end.
I have found other stackoverflow posts like here and tried those options too
You should undo all other pending changes from the root of the branches.
Then only you would be able to migrate the shelveset.

Resources