RCS problem

Jonathan I. Kamens jik at athena.mit.edu
Mon Jan 15 15:39:56 AEST 1990


In article <1000 at whizz.uucp>, bbh at whizz.uucp (Bud Hovell) asks why log
comments are not preceded by "# " when he checks in the file
Pnews.header and then checks it out again.

>From the man page for rcs(1):

     -cstring   sets the comment leader to string. The comment
                leader is printed before every log message line
                generated by the keyword $Log$  during checkout
                (see co). This is useful for programming
                languages without multi-line comments. During rcs
                                                       ^^^^^^^^^^
                -i or initial ci, the comment leader is guessed
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                from the suffix of the working file.
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

It pretty much sucks that the man page does not elaborate on how the
"guessing" is done.  The file rcsfnms.c in the sources contains the
following table:

struct compair comtable[] = {
/* comtable pairs each filename suffix with a comment leader. The comment   */
/* leader is placed before each line generated by the $Log keyword. This    */
/* table is used to guess the proper comment leader from the working file's */
/* suffix during initial ci (see InitAdmin()). Comment leaders are needed   */
/* for languages without multiline comments; for others they are optional.  */
        "c",   " * ",   /* C           */
	"csh", "# ",    /* shell       */
        "e",   "# ",    /* efl         */
        "f",   "c ",    /* fortran     */
        "h",   " * ",   /* C-header    */
        "l",   " * ",   /* lex         NOTE: conflict between lex and
franzlisp*/
        "mac", "; ",    /* macro       vms or dec-20 or pdp-11 macro */
        "me",  "\\\" ", /* me-macros   t/nroff*/
	"mm",  "\\\" ", /* mm-macros   t/nroff*/
        "ms",  "\\\" ", /* ms-macros   t/nroff*/
        "p",   " * ",   /* pascal      */
        "r",   "# ",    /* ratfor      */
        "red", "% ",    /* psl/rlisp   */

#ifdef sparc
        "s",   "! ",    /* assembler   */
#endif
#ifdef mc68000
        "s",   "| ",    /* assembler   */
#endif
#ifdef pdp11
        "s",   "/ ",    /* assembler   */
#endif
#ifdef vax
        "s",   "# ",    /* assembler   */
#endif

        "sh",  "# ",    /* shell       */
        "sl",  "% ",    /* psl         */
        "red", "% ",    /* psl/rlisp   */
        "cl",  ";;; ",  /* common lisp   */
        "ml",  "; ",    /* mocklisp    */
        "el",  "; ",    /* gnulisp     */
	"tex", "% ",	/* tex	       */
        "y",   " * ",   /* yacc        */
        "ye",  " * ",   /* yacc-efl    */
        "yr",  " * ",   /* yacc-ratfor */
        "",    "# ",    /* default for empty suffix */
        nil,   ""       /* default for unknown suffix; must always be last */
};

  What you need to do is first check in the file, then use the -c option
of the rcs command to change the comment leader, then check it out, and
you should be OK.

  The other thing you can do is create an empty rcs file with the
correct comment leader using "rcs -i -c'# ' Pnews.header", then actually
check in the first revision of the file.

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list