2

Regardless of whether it is a bug, that TFS forces files to be in the pending changes section, even when there are no changes, is there a downside to checking those files in?

Please note that according to this, the way to get rid of files that have no changes, would be to issue the following command with TFS power tools:

tfpt uu /noget /r 

What is the downside of checking in files that have no changes? Does it pose some sort of obstacle to the regular agile TFS workflow? Why shouldn't I check in files that have no changes?

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062
  • Not sure how your situation might be different, when I check in any files with no changes I get a report/message something along the lines of 'No changes between working copy and source control, aborting pending changes for file xxx.yyy' – Joe C Jul 24 '17 at 17:32
  • what if you have dozens of files? are you going to make this comment for every file in your changeset? – Alex Gordon Jul 24 '17 at 17:33
  • 1
    I dont make any comment. TFS just lets me know that it is not checking anything in for those particular files. – Joe C Jul 24 '17 at 17:34
  • 1
    TFS seems to inherently reject check-ins with no changes. My best efforts at checking in an unmodified file only ever resulted in "All of the changes were either unmodified files or locks. The changes have been undone by the server." – Bradley Uffner Jul 24 '17 at 17:42
  • yes but your changeset might have 100 files, 2 of which have actual changes, and when you actually commit, then all of your files will be included as part of that changeset, not only the 2 – Alex Gordon Jul 24 '17 at 17:50
  • Its really a bad practice to check in unmodified files. Generally the file appear when there are some formatting changes. For saving time of reviewer one should not sent in code review as well. Note for reviewers If reviewer saw such files reject the review request. Note for sender : BE professional ! Take time to review your work and revert back such changes or give appropriate comment if needed in any case. – Ramankingdom Jul 25 '17 at 07:17

2 Answers2

1

From everything I've found, TFS (2017) inherently prohibits unmodified files from being checked in. If you try to force the issue, the server will reject the "changes" with the error:

All of the changes were either unmodified files or locks. The changes have been undone by the server.

If you mix changed and unchanged files in a single check in, only the modified files actually leave any record. The server undoes the "changes" to the unmodified files as if they had never been modified. The resulting changeset will only show files that were actually modified.

Bradley Uffner
  • 16,641
  • 3
  • 39
  • 76
  • Maybe that's an improvement that's finally been made with 2017, but that was certainly not the case with 2013 and 2015. I should stress I'm talking about the mixed check-in scenario. – John H Jul 24 '17 at 17:52
  • All my testing was done with Visual Studio Team Services, essentially, the cloud based version of TFS 2017. My understanding was that it worked at same way in all previous version of TFS, but I don't have them available to test on. – Bradley Uffner Jul 24 '17 at 17:57
0

The solution that worked for me after many attempts is this: When receiving the message all of the changes were either unmodified files or locks. the changes have been undone by the server That means no change is made, Therefore the tfs rejects the change When I made a change and then I did a check in it wrote to me that it worked, In my case I did not understand why it does not save me all the changes when I run Chrome, or Explorer This is the answer- 3 steps: In the menu - Project - Properties The debug of the file I needed was on a local debug I changed to debug only enter image description here

Then I changed in solution the problematic file I had Report Project1 and then I pressed a right key I changed The access to sql that was old in TARGET SERVER VERSION

enter image description here Then I did a deploy to the file and finally worked it out