Announcement

Collapse
No announcement yet.

Defining unimportant matching differences

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Defining unimportant matching differences

    Hi, I am using BC 4 to compare folders containing files of different release of the same software code (C code). I use text comparison report statistics to get metrics about added/changed/deleted lines.
    Problem: in the new release some functions have only changed their names so I have lots of differences (in function declaration and every time it is called) only for a name change. Is there a way to consider unimportant a change like:

    LEFT TEXT: function_name_a
    RIGHT TEXT: function_name_b

    so that it is considered unimportant when there is a match in a correspondent line and important for example in lines where there are other differences or in orphan lines?

    Thank you.

  • #2
    Hello,

    Yes, the BC4 Pro feature Text Replacements is specifically designed for replacing a change like this and marking it as unimportant. You can define a replacement in the Session Settings dialog, Replacements tab. The '?' Help button (next to the 'X' Close button) is context sensitive to the current view of the dialog, and will bring you straight to Replacements help if needed.

    If you have Std edition, then you can either trial the upgrade to Pro:
    http://www.scootersoftware.com/suppo...?zz=kb_evalpro
    Or you can define a general Unimportant grammar (which is unimportant regardless of what it is aligned to)
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment


    • #3
      Originally posted by Aaron View Post
      Hello,

      Yes, the BC4 Pro feature Text Replacements is specifically designed for replacing a change like this and marking it as unimportant. You can define a replacement in the Session Settings dialog, Replacements tab. The '?' Help button (next to the 'X' Close button) is context sensitive to the current view of the dialog, and will bring you straight to Replacements help if needed.

      If you have Std edition, then you can either trial the upgrade to Pro:
      http://www.scootersoftware.com/suppo...?zz=kb_evalpro
      Or you can define a general Unimportant grammar (which is unimportant regardless of what it is aligned to)
      http://www.scootersoftware.com/suppo..._unimportantv3
      Thank you Aaron,
      Text Replacememnts works correctly for me. I have another question. Is it possible to set replacements using a script?
      Or I have to set them manually and save session as default if I want a script uses them?
      Thank you for your help,

      Centaine

      Comment


      • #4
        Hello,

        We do not expose the Replacements in scripting. Script could load a saved Folder Compare, which could have files pre-aligned (same name or Alignment Overrides defined), which can then have saved child settings for the Text Replacements.
        Or you can set the Text Replacement as part of the Text Compare default session settings, on the Home screen, Saved Sessions list, Edit Session Defaults/New folder. Any defaults would be used in any future comparisons. This would be the easier solution if any comparison could use these Replacement definitions.

        For advanced scripting, you could also setup a Portable Install, and use another scripting program to alter our BCSetting.xmls on the fly before calling bcompare.exe @script.
        Aaron P Scooter Software

        Comment


        • #5
          Thank you,
          the first solution works, I'd like to try also with scripting (as you suggested) since I already use a bash script to call beyond compare BCompare @script . I think I can you use bash scripting or awk or something like it to modify BCSettings on the fly.

          But BCSettings.xmls is accessible only in Portable Install? I haven't tried yet to set up the portable install... but I wonder if there is not another way to get it for example exporting settings.

          Thank you for your help

          Centaine

          Comment


          • #6
            Our BCSetting.xmls are accessible in a normal install, too, but they are associated with your specific Windows User account, in your %AppData%\Scooter Software\Beyond Compare 4\ folder. You then would need to make sure the script runs as the same Windows User in order to access these settings. A portable install runs with the same settings regardless of which user is activating it, which can make its use in scripted solutions easier.
            Aaron P Scooter Software

            Comment

            Working...
            X