No announcement yet.

Content filter

  • Filter
  • Time
  • Show
Clear All
new posts

  • Content filter

    If I have two C++ sources with a difference like:

    1st version:

    #include "header.h"

    2nd version:

    #include "header_new.h"

    ... (particularly after some severe renaming, touching many files). What is the best way (if any) to exclude this step from a comparison of the complete source tree in order to filter out files containing exclusively these trivial changes?


  • #2
    If you want to ignore files with this change in your Folder Compare view, first define the default Text Compare to ignore that change. Define a grammar element for your *.cpp file format that ignores #include "header.h" and #include "header_new.h"
    Or use the BC3 Pro feature "Text Replacements" to set "header.h" equal to "header_new.h"

    Then, when you double click and view your files in the Text Compare, it will ignore that difference.

    Once that is set, you can have your Folder Compare automatically run a Rules-based comparison which compares the text values of your files, and by default will ignore that text. Use the Folder Compare's Session menu -> Session Settings, Comparison tab. Check Rules-based comparison.

    To set the default text replacement for all Text Comapre sessions, go to the Home view, expand the Edit session defaults folder, go to Text Compare, Replacements tab, and create a new Replacement. Test it by then opening a pair of your files and making sure your defined text is no longer red.

    Here is a KB article for defining Unimportant text (if you do not have BC3 Pro):
    Beyond Compare is a multi-platform utility that combines directory compare and file compare functions in one package. Use it to manage source code, keep directories in sync, compare program output, etc.
    Aaron P Scooter Software