Menu

#1172 Source code includes "// RCS-ID: $Id$"

Undefined
open
nobody
None
Feature_Request
2022-10-23
2022-01-01
No

Just stumbled on some source code files that include ancient (okay very old) RCS lines as follows:
"// RCS-ID: $Id$

These should be removed. I will supply a patch in the next few days.

Discussion

  • Andrew Cottrell

    Andrew Cottrell - 2022-01-01

    I used grepwin remove the RCS-ID info using the following process. The first line after the step # is the regex search and the second line is the replace line if one exists with the exception of step 6.

    Step 1:
    //[ \t]+RCS-ID:[ \t]+\$Id\$(\n|\r|\r\n|\n\r)//
    //

    Step 2:
    //[ \t]+RCS-ID:(\n|\r|\r\n|\n\r)//
    //

    Step 3:
    //[ \t]+RCS-ID:[ \t]+(\n|\r|\r\n|\n\r)//
    //

    Step 4:
    //[ \t]+RCS-ID:[ \t]+\$Id\$(\n|\r|\r\n|\n\r)(\n|\r|\r\n|\n\r)

    Step 5:
    //[ \t]+RCS-ID:[ \t]+\$Id\$(\n|\r|\r\n|\n\r)

    Step 6:
    Manually change the following files:
    src\plugins\contrib\BrowseTracker\btswitcherdlg.cpp
    src\plugins\contrib\BrowseTracker\btswitcherdlg.h
    src\plugins\contrib\keybinder\cbkeyConfigPanel.cpp
    src\plugins\contrib\keybinder\cbKeyConfigPanel.h

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-01-20

    Any chance of this getting looked at sooner rather than latter as merging code is becoming a pain point with all of the changes occurring in the areas I am working on?

     
  • Andrew Cottrell

    Andrew Cottrell - 2022-02-22

    Patch supplied that is a result of the following bash script:

    #!/bin/bash
    
    if [ "$(id -u)" == "0" ]; then
        echo "You are root. Please run again as a normal user!!!"
        exit 1
    fi
    
    for srcFilename in $(grep -rl --include \*.cpp --include \*.h RCS-ID ./)
    do 
        echo "sed - $srcFilename"
        sed -i '/\/\/\s\+RCS-ID\:/d' $srcFilename;
    done
    
    for srcFilename in $(grep -rl --include \*.sh --include \*.ac --include \*.m4 RCS-ID ./)
    do 
        echo "sed - $srcFilename"
        sed -i '/\#\s\+RCS-ID\:/d' $srcFilename;
    done
    
     
  • Andrew Cottrell

    Andrew Cottrell - 2022-10-22

    Last try
    Same script as per 22-Feb-2022 post above.

    The SVN command used to create the patch is:
    svn diff -x "--context 0 --ignore-eol-style" > ../SF_1172_RCS_Removal.patch

    Updated patch against r12990 is attached.

     
  • Morten MacFly

    Morten MacFly - 2022-10-23

    As you might have recognised, most of the files are actually 3rd party. We don't want to modify any third party code if not absolutely required. If that happens, these changes should be documented (like "C::B change" or alike).

    I don't see "absolutely require" for the cases you mention. So please, don't remove these tags from the code that we are using from 3rd parties. If you really need to do, please document each change and tell why it is needed.

     
    • Andrew Cottrell

      Andrew Cottrell - 2022-10-23

      Bye

       

Log in to post a comment.