Name of the blog

Short description of the blog

Ignoring Files with pcmignore Files


One of the key features of the 2012/2 PureCM release is the introduction of pcmignore files. I want to explain what they are and how they can make life easier for you. If you are familiar with gitignore files then we have some good news - they are identical.

 

The Problem – The Ignore File Paths Policy

 

More often than not there are files in a workspace which you do not want to control. These might include user option files or build files. The previous way of handling this in PureCM was to update the 'Ignore File Paths' policy. So the policy might include the pattern '*.obj' to ensure object files are not added to PureCM.

This policy will carry on working the same as before so if this is working well for you there is no need to change anything. But you may not like this way of working for one or more of these reasons:

  • It is difficult to maintain the 'Ignore File Paths' policy, especially if you have different patterns for different streams. If you decide you want to add a new pattern you have to update this policy in each policyset.
  • Users need to access the Administration view to update the policy. It is unreasonable to expect all developer to become familiar with PureCM policies.
  • Users need to be a Policy Administrator to update the policy. It is very common that an Administrator would not want all users to be able to update all policies.
  • You cannot specify complicated rules. For example you could not say "Exclude all files in a 'Debug' directory except the files in '/src/Debug'".

For these reasons many users have stopped using the 'Ignore File Paths' policy preferring to manually remember which files to not add. But this approach is not recommended for the following reasons:

  • New developers might not know which files to exclude.
  • You are less likely to run the Check Consistency Wizard which makes it more likely that you will forget to add a new file.
  • You cannot use the 'Monitor the workspace for file changes' feature which will automatically add files to your workspace when you create them.

 

Better in Every Way - pcmignore Files

 

Using pcmignore files will resolves all these issues. A pcmignore file specifies any number of exclude and include patterns. This is similar to the 'Ignore File Paths' patterns but you can specify include patterns the same as exclude.

When you put the pcmignore file in a folder, the include and exclude rules are applied to that folder and any subfolders. So it is easy to specify complex rules like "Exclude all files in a 'Debug' directory except the files in '/src/Debug'". The root pcmignore file will have a rule to exclude all files in a Debug directory. The 'src' directory has a pcmignore file with a rule to include the Debug directory.

The pcmignore files are submitted to PureCM the same as any other file. Other developers start using the new pcmignore rules after they update their workspace. Developers can add new rules or update existing rules easily by checking out the pcmignore file, updating it and submitting the change.

 

Switching Over

 

Hopefully you are eager to start using the new pcmignore files. To get going you need to add a file with the name '.pcmignore' at the root of your workspace. This file contains all the exclude and include rules which apply to all folders in the workspace. You can download a good starting point from here.

Note: If you create a new stream from scratch then the default .pcmignore file is added automatically.

There are many example gitignore files which you can download here. pcmignore files and gitignore files are identical, you can even call the file .gitignore.

After adding the root pcmignore file you can go through each entry in the 'Ignore File Paths' and add any useful patterns to the pcmignore file.

The best approach is then to clear your 'Ignore File Paths' policy and run check consistency on a workspace where everything has been built. Look at the files which PureCM wants to add and add them to the pcmignore file. Keep doing this until running check consistency finds no new files.

PureCM Now Offers Subversion Importer

Good news for the many software developers looking to upgrade from Subversion to a more robust change management tool. PureCM now features a Subversion importer that will import an SVN trunk with full history.

Anyone looking to do an evaluation of PureCM will now be able to quickly and easily import real data from an existing SVN repo into PureCM in order to get the best possible test drive of the system in the least amount of time. This will be a huge benefit to people who ask the question, "but how will my projects look in PureCM"? Now you can tell and with minimal effort since the import is a point and click process.

Customers looking to switch off Subversion will also be able keep their old historical data by transferring into PureCM which provides the key advantage of being able to get started with PureCM while retaining your old data. Perhaps a bigger benefit is now you can leverage pre-existing IT infrastructure to properly backup this business critical data by hosting PureCM against SQL Server.

Importing data is an important part of what we do at PureCM. We recognize that many of our customers are switching to PureCM from something else. Importing data through a script or an API is always a possibility but not the quickest and easiest solution and for that reason PureCM has put a lot of effort into providing importers for as many SCM tools as possible, such as Visual SourceSafe, CVS and Perforce; and now Subversion joins the list.

Visit our knowledge base to get a step-by-step guide about how to use the SVN importer.