3

I have been tasked with maintaining a Nuget package for a project. In transferring the source files to the package, I need to append a ".pp" file extension to each file so that they can be transformed according to some variables within the file (pp is "project properties").

On an ongoing basis, the simplest way to do this would be to diff the Nuget content folder and the current source code folder. The problem with this approach is that Beyond Compare, as far as I can tell, can't compare basecontroller.cs and basecontroller.cs.pp. I can compare them manually by specifying the filename on the right, but when you're dealing with thousands of files, this is a very tedious process.

Is there some way I can tell BC "on the right-hand side, ignore the pp extension when resolving filenames for comparison"? Or "On the left-hand side, append pp when resolving filenames for comparison"? Or something else that achieves this same result?

4

As is so often the case, I found the answer myself five minutes after asking publicly about it :).

The answer is a feature called "Alignment Overrides". This is reached by:

  1. Session...Session Settings
  2. Misc tab (this is only available in a Folder Comparison project)
  3. Enter a series of Alignment Overrides.

In my case, the Alignment overrides I needed to enter were as follows:

  • *.cs.pp => *.cs
  • *.cshtml.pp => *.cshtml
  • *.asax.cs.pp => *.asax.cs
  • *.asax.pp => *.asax

Once I did this, it worked perfectly.

|improve this answer|||||
  • 1
    Good job self-answering! – JakeGould Nov 7 '17 at 16:50
  • 1
    For a simpler case (.cs on the left, .pp on the right), you can also check Align filenames with different extensions in the Comparison tab of Session > Session Settings. – Chris Kennedy Nov 8 '17 at 22:47
  • If you just need it once, you can right-click the left file, choose 'Compare to...' and then click the file to the right – PieBie Jul 18 '19 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.