How to configure BeyondCompare to ignore SCM replaced text in comments?

I have some text sequences that are replaced by SCM (Perforce in my case).

I want to configure BeyondCompare to treat these sequences as minor differences so that I can ignore them when comparing files.

In my case, this about Python source files and sequences looks like

# $Id: //depot/.../filename#7 $ # $DateTime: 2010/09/01 10:45:29 $ # $Author: username $ # $Change: 1234 $ 

Sometimes these sequences may be outside the comments, but even then I would like to ignore these lines because they really are not changed.

+19
version-control perforce ignore beyondcompare
Sep 06 2018-10-06
source share
2 answers

Unlike the comparison parser, currently (v3 / v4) support for nested elements, therefore file format grammars cannot be used to designate an SCM sequence as inconsequential for a certain file type if the text is already classified as a comment, line, etc.

Beyond Compare 4.0 added support for marking arbitrary text as irrelevant in the entire comparison, separate from the grammar.

  • Download the files you are interested in.
  • Click the Session Settings button (aka Rules with a symbol / hit) or use the menu item Session-> Session Settings . li>
  • Go to the Importance tab
  • Click the + button at the bottom of the Unimportant Text list.
  • Add plain text or a regular expression in the Text to find , and check the Regular expression box if necessary. In this case, the regular expression will look like this: \$(Id|DateTime|Author|Change):.*\$
  • Click OK .
  • By default, these changes only affect the current comparison. You can change the drop-down list at the bottom of the Session Settings dialog box from Use only for this view to Also update the default settings to affect all future comparisons for all file types.
+3
Apr 29 '16 at 21:59
source share

You need to define a new grammar element (name it “SCM”) and mark it as non-essential ( see the tutorial here ; “Basic” and be sure to check “Regular Expression”).

The grammar element should be (if I interpret your examples correctly):

 ^.*\$(Id|DateTime|Author|Change):.*$ 

This will ignore any string containing $Id: $DateTime: etc.

If you want to ignore lines starting with # $... use

 ^\s*#s*\$(Id|DateTime|Author|Change):.*$ 

And if you want to ignore stuff between $ (and relate to everything else as important), use

 \$[^$\r\n]*\$ 

or

 \$(Id|DateTime|Author|Change)[^$\r\n]*\$ 

depending on whether you care about these keywords or not.

+16
Sep 06 '10 at 15:12
source share



All Articles