aspnet / Tooling

Issue tracker and info on Visual Studio tooling for ASP.NET
Other
256 stars 124 forks source link

Things in ".tfignore" still are shown in the Solution Explorer (and in pending changes) #18

Closed tommck closed 8 years ago

tommck commented 9 years ago

Using TFS as our Source Control, we have a few folders in our ".tfignore", yet the folders are not ignored by visual studio and always show up in the Solution Explorer and also in the "Pending Changes" view.

So, it's not doing what I think it should be doing.

JohannesHoppe commented 8 years ago

Same here, we do dnu web and keep Visual Studio closed all the time during development. The "$ in front"-hack works, but VS is so unbelievable slow... Worst Microsoft-experience we ever had. Some years ago a RC candidate was somehow usable. But this is just embarrassing now. TFVC is dead technology, everybody should switch to GIT.

bbsimonbb commented 8 years ago

For me, a minimum requirement would be a concise statement of the problem. I'm just getting started with .tfignore, in a project using the empty web application template, in VS2015. .tfignore doesn't appear to have any effect, but I don't know if this is due to this problem, or something else.

sayedihashimi commented 8 years ago

I met with the TFS team today to discuss this issue and I have an update here.

We have investigated multiple ways to solve this problem. The ideal solution is to make .tfignore work exactly as .gitignore does. That would mean to bring ignore processing to server workspaces. This would require extending existing contracts and it has the potential to destabilize the entire TFS experience. We thought that would be too risky, especially for an install going into VS Update. So we started looking at other options.

The fundamental issues here is that both the project system (.xproj) and the VS Source Control provider is raising add/edit events for source control. In this case when the project system calls Add File, the .tfignore file is not examined to ensure that the file shouldn't be added. Effectively to the user the .tfignore file was not used.

To solve this we are planning to update the logic when a file is added to source control. For this particular case, when a file is added the Source Control client will look to see if the file is matched in .tfignore. If the file is matched in .tfignore the file will not be added.

For the case where you want to explicitly add a file to source control which has been ignored you can Right Click and select Add To Source Control. You'll be prompted to confirm since it's ignored.

For the case of multi-selecting files there are two cases.

  1. All files are listed are ignored
  2. Some files are listed as ignored and others as not ignored.

For 1: since all the files are ignored you'll be prompted to confirm adding the ignored files. For 2: we assume that you meant to add the files that are not listed in ignore and leave the rest as is. You'll need to specifically select ignored files.

There is also one more caveat here. When .gitignore is used, for ignored files you'll get a red glyph on the icon indicating that the file is ignored. This is possible by having the ignore processing on the server side. With the ignore processing happening on the client side adding this glyph is not feasible.

We are hoping to ship these changes in VS 2015 Update 3. Additionally we are targetting VS2015 Update 3 Preview 1, which is the first public preview of Update 3. The team is currently finishing up the dev work here and it will enter verification soon. We are pretty confident that this will make it into Update3, and in the Preview1, but there are some chances that we may find something during verification that could delay this. If we find anything that would cause this to get delayed I will let you know right away.

ghost commented 8 years ago

Thanks for the update :+1:

tommck commented 8 years ago

@sayedihashimi How can I test that Preview when it's out? I volunteer wholeheartedly to test that :)

sayedihashimi commented 8 years ago

@tommck the first time you can try it is when VS 2015 Update 3 Preview 1 is released (assuming all goes well of course).

JohannesHoppe commented 8 years ago

destabilize the entire TFS experience

Sorry, but this has already happened!

I don't understand the implications of such a .tfignore file. It should provide a list of patterns that must be ignored. In my eyes this feature is fundamentally broken. Why don't you fix the root cause of the problem?

dankellett commented 8 years ago

"Ideal solution" != "fixing the root cause"

To me it sounds like their solution will work just fine.

BasPaap commented 8 years ago

Having to wait for the preview is one thing, but having to wait until update 3 is final is going to take months. I'm sure there are many developers out there who can't (or won't) use the preview versions of updates, and also can't just put their projects on hold for half a year or so. So while we wait for update 3, is there a workaround we can use to get TFS to ignore certain files?

ghost commented 8 years ago

@BasPaap put them in a folder that starts with $ is the only workaround I know off.

uxp commented 8 years ago

For 2: we assume that you meant to add the files that are not listed in ignore and leave the rest as is. You'll need to specifically select ignored files.

@sayedihashimi IMO, this should act exactly the same as if you are copying or moving a directory in Windows Explorer to another folder that already contains a directory of that name. It should successfully add the files that are not duplicates (matched in .tfignore), and prompt to overwrite or retain the existing (confirm to add despite an ignore match). It sounds like you described a silent failure when adding multiple files to source control when some might be matched as ignore. I hope this is not the case.

That said, I'm anxiously waiting for this fix to hit the pipeline. Thank you to everyone that's contributed to this issue. I just switched to developing on Windows from almost a decade of developing for the web and mobile on a Mac or Linux box with SVN or Git, and I'm absolutely shocked at the number of subtle expectations that Windows developers are supposed to follow and conform to just because their tools don't support anything else. I shouldn't have to wait until the seven moons of the solar system align before a file's expected behavior gets honored. All complaints aside, my team can develop a hacky workaround to get around this issue for the time being. Thank you.

mikes-gh commented 8 years ago

@uxp if your from a git background I'd stay with that, I just moved all my code from visual studio online tfs to bit bucket so I'm going the opposite way to you. I have to say git is a revelation for me. Visual studio has a pretty good git client these days too. Besides the various issues in this thread I always ended up with a huge ignores list and I could never delete erroneous projects from Tfs. I also have the security that I can move my project with its history intact to another provider easily.

uxp commented 8 years ago

@mikes-gh I may be from git, but I can't magically convert my entire team to git as easily as just waking up and doing it.

TFS has benefits for many reasons. This just happens to be not one of them ;)

bburman commented 8 years ago

@sayedihashimi Would a hotfix be an option? I know that many of us would be willing to accept the risk of destabilizing our TFS experience if it could just get us to Update 3. If not, can you perhaps outline some hacks or workarounds that can get us to that point? Would it be possible for us to write a custom Visual Studio extension that could correct the issue on our end?

IAMtheIAM commented 8 years ago

Amazing that such a basic feature (ignoring check-in of file/folder) does not work in the 2015 edition of visual studio. Are we living in 1990?

Boogier commented 8 years ago

waiting for a fix...

hobe commented 8 years ago

Unfortunately this issue is an absolute showstopper for our project (Angular2+asp.net core+VSTS) it's very frustrating that such essential features aren't fixed at this state of the whole asp.net core project.

DaEkstrim commented 8 years ago

I really wish there's at least a quick fix to this issue. Each time that the task runner is invoking grunt build tasks, the TFS client is going berserk and increasing build time considerably while trying to inform the TFS server that 6,000 files have been updated/moved/deleted or renamed. Not to mention the insane number of errors generated in the Output window because the files from the previous build are still checked out.

shanselman commented 8 years ago

The new behavior is in VS2015 Update 3 (now as a RC, coming soon, perhaps in a day or so?) @sayedihashimi

sayedihashimi commented 8 years ago

Yes it's coming out soon. My team verified the changes and they look good. I'm not sure the exact release date.

BasPaap commented 8 years ago

How is that "soon"? We run production software here, not betas or release candidates. If the team is not even sure of the RC's release date, then that must mean the final version is still months out. Which means many, many more months with this absolute showstopper of a bug. Unacceptable. At least provide a hotfix for this particular bug.

bburman commented 8 years ago

Thanks for the update @sayedihashimi. Simply cloaking the dynamically generated directories in TFS has been an acceptable workaround for my team. It's a little tedious to set all of the mappings up on each of our machines, but it is working for us, nonetheless.

hobe commented 8 years ago

It works in Update 3 RC! :+1: https://blogs.msdn.microsoft.com/visualstudio/2016/06/07/visual-studio-2015-update-3-rc/

DaEkstrim commented 8 years ago

Update 3 RC: I might need to analyse this further, but preliminary analysis is showing that if I run a grunt task during runtime, the output window is still showing TFS client error entries on folders that are in the .tfignore. However they are not showing up in the Pending Changes (which is a good thing). Performance has definitely improved.

jimbuck commented 8 years ago

Update 3 is live!

cheezburger-cat-best-of-week-hyped-u4Ac3yBekb2r6

Tenmak commented 8 years ago

Using VS 2015 RC3 and gulp, the .tfignore is indeed working correctly for me as well. Cheers !

delie commented 8 years ago

Unfortunately, the implementation is still buggy. "Source Control - Team Foundation" output moans about files which it shouldn't care about in the Output window.

For instance..

  1. Add some files to a folder
  2. Add that folder to .tfignore
  3. Delete one of the files
  4. You'll see a line appearing in the Output window, which then grabs focus and takes you away from anything else you were looking at at the time.
  5. Add new files, repeat, same thing happens - so it's not just files that previously existed.

Example output: The item C:\Dev\test\src\tester\wwwroot\build\polyfills.bundle.js could not be found in your workspace, or you do not have permission to access it.

Well, yes.. correct...it doesn't exist anymore, because we deleted it, but TFS shouldn't care about this because wwwroot\build is in my .tfignore file

tommck commented 8 years ago

Well, better late than never. Yes, there may be another bug or two, but I'm going to close this issue, since it is finally doing mostly what is needed. Perhaps folks will need to create a new issue for the new problems with the Output window errors.

delie commented 8 years ago

Ok, fair enough. I've created a new issue for the output window bug here: #661

airomero commented 8 years ago

Hi, i'm using VS2015.3 Enterprise. I'm working on an aspnet core 1.0 project. I have a .tfignore at the root of my web project that look like this:

wwwroot\css\themes wwwroot\npm

When i go to pending changes both folders are always there to commit to VSTS. IS this a bug or am i doing something wrong?

Thanks

LifeguardConcepts commented 8 years ago

@airomero. You are not doing anything wrong. Instead of fixing the issue at the provider level they fixed it through VS Tooling which is version specific so you may not get the fix. It's also the reason why it's still showing in the output window.

In honest opinion it was a quicker fix but not the proper one.

airomero commented 8 years ago

So why is this closed?? If it was through vs tooling, what should i install to get it working. It is such a basic requirement, this should be fixed. And also this issue should not be closed.

LifeguardConcepts commented 8 years ago

You are on vs 2015 with update 3 so it should work...

airomero commented 8 years ago

It doesn't work. That's why i'm asking if i'm doing something wrong. i just put the .tfignore in the root of the net core project with the paths:

wwwroot\css\themes wwwroot\npm

But both still are in pending changes every time i want to do a check in.

JauernigIT commented 8 years ago

If they are "still" in pending changes, first create a backup copy, then make an Undo on them. Close VS, restore the backup copies and then it should work (cumbersome, but worked in our project).

delie commented 8 years ago

@airomero - Do you have an RTM or CTP version of VS 2015 Update 3? Are you sure you're using the full release version?

tommck commented 8 years ago

I closed it because I was the one who opened it and the problem I reported was fixed. the .tfignore file is working fine for me.

Tenmak commented 8 years ago

@airomero Maybe the problem comes from your .tfignore file itself as well...

Mine looks like this :

# Ignore all files in the corresponding subfolders :
\app
\node_modules
\app_themes
\css
#
# Do not ignore folder \js !
!\js
airomero commented 8 years ago

Solved. @JauernigIT based on your answer, I deleted the entire solution from my disk, downloaded again from VSTS and then it worked. Apparently the problem is that the folders I want to ignore must be created after the .tfignore exists. When it didn't work I created the .tfignore after the folders and its content were created. So, first .tfignore and then folders. Weird.

JauernigIT commented 8 years ago

Yeah, when you add a file/folder first and TFS/VS then has it in Pending Changes, it doesn't get it out of there when you add a .tfignore. I'm not sure if it's a bug or a feature ;-)

delie commented 8 years ago

I don't think you can call it a feature. If it was a feature, the gui would highlight the fact that you've excluded something that is already pending, or even already checked in, and then prompt you to decide what to do. That would be a feature :)

To be fair, .gitignore files work in exactly the same way.

RezaRahmati commented 7 years ago

I have same issue VisualStudio2013 + Tfs2017 http://stackoverflow.com/questions/42537053/tfignore-is-not-ignoring-files

weitzhandler commented 6 years ago

I'm also having this issue in VS 15.4.

After adding /.vs and /.vs/* to the .tfignore file, that folder still appears under 'Pending Changes'. How do I exclude that folder for good?

barrytang commented 6 years ago

To report new issues, use the Report a Problem tool. The GitHub Issue Tracker for the aspnet/Tooling repo is now deprecated in favor of the Report a Problem tool.

If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks. See here for more details.