TFS unable to ignore tracked files - eclipse

I'm using Eclipse (Spring tool suite to be exact) for a Maven project and the TFS plug-in v14. I'd like to ignore some files which are tracked by TFS, as they'll change between development machines. However, despite adding all files to be ignored to .tfignore, they are still detected as pending changes.
For instance, the following files are present on the project root:
.classpath
.project
.springBeans
.tfignore
pom.xml
The tfignore file:
\.project
\target
\src\main\resources\profiles\DEV
\.tfignore
\.classpath
\.settings
\.springBeans
I've also tried adding \.*, .springBeans. I've tried checking in the tgignore file before any changes as well, all to no avail.
Excluding changes only works temporarily as when switching branches, all changes must be shelved or undone.
When performing the same operation through the Eclipse context menu for TFS (Team > Ignore) the error "Exclusions could not be added for some items
Error adding exclusion for C:\Users\user\Documents\workspace-sts-3.6.3.SR1\VTS\.springBeans parentPath must not be null" is shown
For the \src\main\resources\profiles\DEVpath, I'm able to cloak the folder server side, but am not able to do so with files in the root of the project (this would cloak the entire project). The option to cloak individual files is not listed through TFS.
Is it not possible to ignore files locally from source control once they're added? I would expect this to be possible.

After researching a bit, I've found that tracked files cannot be ignored by Team Explorer Everywhere TFS Eclipse plug-in. The source will need to be cloaked to ignore local changes from being detected under pending changes.
As for files in the root of the project which change based on a developer's environment, these should be removed from source control all together. Initial setup of the environment should produce these derived files (setting this flag in Eclipse also has no effect on tracked files). Once placing these in .tfignore, the plug-in ignores these as expected.

Related

Eclipse TFS branch show also changes in root

I'm using Eclipse importing TFS projects, one project is:
$/product mapped to C:\dev\product
I opened a branch and started working on different workspace:
$/product-branch mapped to C:\dev-branch\product
I worked on each project successfully
But now in branch in TFVC Pending Changes I see changes I made (checkouts) also in C:\dev\product ($/product)
Why am I seeing such changes and How can I separate those branches when I switch to different workspace?
EDIT
My TFS 2010 is using server workspace.
A TFVC workspace is the container for all of the work that should be grouped together (think of it like the contents of a Git repository). Now if you open a sub-folder of a Git repository in Eclipse and you've made changes at a folder that's higher up (that is, one you didn't explicitly open), the Git SCM still shows those files. It doesn't only show the files modified for the folder that you've got open. That's the same behavior as what the TFVC support is currently showing.
If you are using server workspace and checked out work under a different workspace, it will also show pending changes in pending changes list. Take a look at this similar issue: https://stackoverflow.com/a/423439/5391065
As a workaround, you could temporarily exclude no need changes in another branch to exclude list.

Eclipse Team Synchronizing View: How to remove unversioned items in outgoing changes?

While viewing the outgoing changes in Eclipse Team Synchronization(Subclipse), I am able to see the unversioned files also, like the generated class files, build folders, etc, which I do not want to see in this view. I dont want to add it to svn:ignore, since I have to do it manually for all the additional folders generated.
Is there any setting to change this to show only versioned files in this mode always?
Tortoise SVN client shows this option while committing, to show only versioned files. I am looking for such an option in Subclipse Team Synchronization view. Thanks in advance.
eclipse_outgoing_view
You should svn:ignore build folders.
Otherwise it's only a question of time until you or your colleague checks in the build folder
You should use svn:ignore, and note that once you do for a folder, all child folders are automatically ignored. In your example, if the build folder were ignored then everything inside it would automatically be ignored. It looks like your build folder has already been added to repository though, so maybe you can ignore the dist folder inside bin.

Red exclamation in Eclipse after build - on classes dir

First, there are no problems with my build path, and there's no problem in the "problems" window regarding this error. What happens is:
I check a project out of SVN
I then build that project
SVN "version" and link gets removed from classes and build directories (and red ! appears)
I can no longer commit project as a whole, as I get this error:
svn: Commit failed (details follow):
svn: Working copy 'C:\Users\<me>\Documents\eclipseSDK\<project>\classes' is missing or not locked
It's NOT missing, it just was "refreshed" during build
I've also tried to delete the dir on the SVN side, but the red arrows still appear and committing throws an error - even though those dirs are no longer part of the checked resources.
Also, basically, any "Team" menu option will no longer work on those two dirs, if I try to Team>Add to Version Control, nothing shows up in the Resources window.
I don't even know if I care about the red exclamation as much as just getting those two dirs out of the SVN process. Like I said, I've deleted on the SVN side even, so they are no longer there.
Are your compiled classes file part of your Subversion repository? If so, GET RID OF THEM FROM SUBVERSION!.
Sorry about the screaming, but files that can be built (like classes and jar files) should not be stored in version control. It just doesn't make sense.
Source control allows you to see the history of changes. You can see who made what changes in the source, but you can't do that in class files or jars. Source control allows you to branch and merge changes. You can't do that with class files. And, they go stale very quickly. No one cares about class files that were built last month.
The biggest issue is sheer size. Binary files don't diff well (and many version control systems don't even try). Let's say you build 15 megabytes worth of class files each time you do a build. That's probably at least 12 megabytes added to your repository each and every time. With in a year, you could be adding, 1 gigabyte to your repository. You can easily end up with the vast majority (and I mean in the 90% range of your source repository being nothing more than compiled code. Compiled code that no one cares about. Compiled code that can't help you understand your development history. Compiled code that clogs up your repository.
Go to your classes directory, and do an revert from the Team menu on that directory. You'll lose all of your changes, but so what? They shouldn't be there. This will set things up, so you can at least commit your changes.
Then, delete that classes directory and all of its contents from Subversion and commit. Eclipse will create the directory when it does a build, and you can make the directory in Ant's build file before you compile the code. You should then set an svn:ignore property on the directory parent to prevent people from checking in the classes directory.
If you need to store jar files for other projects to use, use a release repository. In fact, use a Maven repository like Artifactory or Nexus. You don't have to use Maven. Ant can use Ivy to fetch the files from a Maven repository, or you can simply use URLs to download the files as needed via wget or the <get/> task in Ant.
OK, I deleted [build & classes] from local, and deleted from SVN. Made a minor edit to a file, just to be able to run Commit - which worked fine.
That's good.
Both local & SVN were in sync. build & classes are (and were) part of ANT build file, so ran build again. build & classes reappeared (with ? this time), and added to svn:ignore.
Any file that's not in the repository will show up with a question mark. Those question marks will disappear if you add the svn:ignore property to the parent directory with classes, sync, and build in it.
Made another file change, but now I cannot commit the entire project, as I'm getting more/different errors now (e.g. "out of date").
The out of date means that someone somewhere modified a file that was in the repository and committed it. It's very likely that the change is one of the *.class files that you removed. You will have to do an update before a commit. When you do the update, you will likely see a lot of conflicts where a class file was changed, but you had removed it. Resolve these changes, update, and commit again.
By the way, I have a pre-commit hook that is useful in this situation. First, it can prevent people from adding that classes directory to the repository (and any files under it). Second it can make sure that the svn:ignore is setup correctly.

In Eclipse I was successfully pulled my Code from Git, but I could See ">" without making any changes to my Local directory

In Eclipse I was successfully pulled my Code from Git, but I could See ">" without making any changes to my Local directory..Is it I am making some error in pulling the code?
Would you describe which specific files are marked as locally changed (">")?
Depending on your repository contents and view settings, I imagine they are files that Eclipse or its plugins generate, such as ".project".
Eclipse IDE uses certain files to record your project settings (".project") and other information about your project such as its Java classpath (".classpath"). By default these files are filtered out and not displayed by Eclipse views such as the Package Explorer. But those filter settings can be changed.
If these same files are stored in your git repository, and if there are any further modifications to those settings within the Eclipse IDE, then the files may become marked as modified since the last commit (">").
Because you did not directly change their contents in a text editing window, and may not even have been aware that they were present at all, you could perhaps be surprised when they show up as locally modified files in a view such as the Package Explorer or the Synchronize View.

tfs build not copying latest config files to drop folder

I have several config files in different projects in my master solution that are set to "Copy if newer" that tfs build is not getting the latest for on each build.
I currently have the build configuration option "Clean Workspace" set to "All". I would think it would be copying the latest files from TFS but it is not. It is getting prior versions.
Furthermore the build folders on my local machine reflect the latest files from TFS. Is there a setting I am missing somewhere?
I managed to find the problem and it didn't have anything to do with TFS. I had multiple versions of the same config file in various projects within my solution.
To correct this I added a single configuration file at the solution level and added it as a linked file in all the projects where I needed it.
How to Share App.config?