ignore copyright notice?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BillT
    Expert
    • Mar 2013
    • 84

    ignore copyright notice?

    My co. has recently been acquired and we now need to update copyright notices in all source files ;-(

    These are several comment lines that appear at the top of the file, and syntax is different depending on file type (C++, bash, etc.).

    I'm trying to come up with a way to ignore these differences by defining new grammar elements that match the old and new notices (using "Lines" category, since these are multi-line comments).

    I don't seem to be having much luck -- either I can mark ALL comments as unimportant, in which case the notices are ignored, but in general that's not a great solution.

    Any hints or tips would be appreciated!

    FWIW, the notices look something like this:



    ///////////////////////////////////////////////////////////////////////////////
    // //
    // OLDCO, INC. CONFIDENTIAL INFORMATION //
    // //
    // Copyright (C) 2002-2007 OLDCO, Inc. //
    // All Rights Reserved. //
    // Licensed Materials - Property of OLDCO, Inc. //
    // //
    // This module contains confidential and proprietary information of //
    // OLDCO, Inc. and any reproduction, disclosure or use in whole or in part //
    // is expressly forbidden except as may be specifically authorized by prior //
    // written agreement or permission of OLDCO, Inc. //
    // //
    // For more information, contact OLDCO, Inc. at www.oldco.com //
    // //
    ///////////////////////////////////////////////////////////////////////////////





    /************************************************** ***********************
    * NEWCO CONFIDENTIAL INFORMATION
    * _______________________________
    *
    * All Rights Reserved.
    *
    * NOTICE: This file and its content are the property of NEWCO. The
    * information included has been classified as Confidential and may
    * not be copied, modified, distributed, or otherwise disseminated, in
    * whole or part, without the express written permission of NEWCO.
    ************************************************** **********************/


  • Aaron
    Team Scooter
    • Oct 2007
    • 15997

    #2
    Hello,

    To fix this, I'd recommend performing a scan to find this specific change. Create new File Format, and in this format a specific grammar to find just the Date that needs updating, and mark that grammar as Important. Then, when using this format, you can mark "Everything Else" as Unimportant. This leaves you with a rules-based scan that is only comparing the date that needs updating. Once this task is complete, disable or delete the new File Format in the Tools menu -> File Formats dialog.

    The main issues is we do not support grammar elements within elements; by having a larger Comment then that text is within and defined as Comment. You can check the current definition/element by clicking the cursor into the text, and the grammar element name of where the cursor is located is shown in the bottom status bar of each pane.
    Aaron P Scooter Software

    Comment

    • BillT
      Expert
      • Mar 2013
      • 84

      #3
      Thanks, Aaron.

      Not quite what I'm trying to do -- what I would really like to be able to do is to be able to compare files with old and new notices while ignoring the notices themselves. (FWIW, the dates don't matter.)

      I did try to prioritize the new grammar elements by moving them to the top of the list of grammar elements, and then deselecting those grammar elements from the list of important elements.

      Also, when I put the cursor in the notice, the only thing on the status bar is "Important Difference", not the actual grammar element name.

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 15997

        #4
        Hello,

        The grammar list helps break ties (if grammars start at the same spot), but otherwise the larger grammar will swallow the smaller grammar. You can't have an Important Comment with an Unimportant date inside of it. The workaround for that would be to remove the Comment grammar element, allowing it to be Everything Else text and be important, and no longer swallowing definitions within it. The smaller date grammar element can then be found/match, and be Unimportant.

        The cursor detects the grammar of the character immediately to the right, but if you click into the date text (blinking, not selected), it should show the detected grammar element name.

        "Important Difference" or other criteria descriptors are used when a grammar element is not detected (Everything Else text).
        Aaron P Scooter Software

        Comment

        • BillT
          Expert
          • Mar 2013
          • 84

          #5
          Thanks.

          I think we're crossing signals here -- I've uploaded a screen shot which illustrates the issue I'm trying to resolve, just somehow making the two copyright banners disappear from the comparison.

          Not sure if grammar is the right approach, or if there's a better way.

          This is not a huge deal, but it would be nice going forward, since once we update the banners every single file will show up as different.
          Attached Files

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 15997

            #6
            Oh, so the issue is the entire banner should 'disappear'. To make something disappear, you'd mark it as Unimportant. This can be done adhoc (per Session Settings) or as a grammar (global File Format).

            You can define a grammar to match on the entire section of the left and right files. I'd suggest two elements such as Delimited:
            ////////// (constant number of slashes for the first line?)
            to
            ////////// (same constant number for the last line?)

            This would match on that header (assuming you define the first and last line), and make that as Unimportant. Define another grammar element with the same name, as Delimited, from
            /***
            to
            ***/

            If they share the same element name, they can be Unimportant together with a single checkbox (Importance tab, uncheck the single entry Element name).

            This would make the entire header Unimportant (Blue), and can be ignored with the Ignore Unimportant Differences toggle.

            We have a KB article and video here:
            http://www.scootersoftware.com/suppo..._unimportantv3
            Aaron P Scooter Software

            Comment

            Working...