[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: $Name$ causes files to be locally modified

From: Todd Denniston
Subject: Re: $Name$ causes files to be locally modified
Date: Thu, 23 Jun 2005 09:37:33 -0500

> "Jorgensen, Steven" wrote:
>         I am having a problem with the $Name$ keyword expansion.  We use a
> cvs tag to indicate when a file has moved beyond local testing stage, and
> is ready for general use by all developers (a release tag if you will) so
> that we can automate a update and build process to keep a working
> development version of our software compiled for all developers.  So this
> tag is not permanently attached to a single revision, rather it moves as
> files get modified and tested by individual developers and released for
> use by other developers.
>         The problem I'm having is when people use the $Name$ keyword in
> their file.  In this tree of "released" software, it causes any file that
> contains a $Name$ keyword to be in a "Locally Modified" state when it is
> checked out.  Where the only difference in the file is the fact that
> $Name$ is now filled out.  The next time around we run an update on one of
> these files that changes, produces a conflict on the $Name$ line.    For
> example:
> Myheader.h
> -----------------------
> const char *tag = "$Name$";
> Becomes on the next revision.
> <<<<<<<< Myheader.h
> Const char *tag = "$Name: releasetag $";
> ======
> Const char *tag = "$Name: $";
> >>>>>>>> 1.2
> Is there any way to prevent this from happening?  On all the other keyword
> expansions $Id$, $Header$, etc, the keyword is expanded, but the file's
> status is "Up-to-date".
> Thanks for any help.
> Steve
> Steven Jorgensen
> address@hidden

Method #1, I think if the update is done with the '-kk' option it will stop
the expansion.

Method #2, tell your developers to stop using keywords and remove them where
ever they find them.

Method #3, do Method #2, and prevent the developers from checking files in
to the baseline with the keywords inside, using a commitinfo script.

*******begin simplistic commitinfo script (in bash)*****
#echo "0($0) 1($1) 2($2) 3($3) @($@)"
#get rid of path at the begining
shift 1
#echo "0($0) 1($1) 2($2) 3($3) @($@)"
for i in $ARGS
# cat $i
# exit 1
 if grep -e \\$Name:\\$ -e \\$Id:\\$ $i
   echo " we no longer allow rcs keywords in the files, find your info in
   echo " cvs log from now on."
   exit 1
*******end simplistic commitinfo script*****

BTW never written a commitinfo before, no warranties on the above script.
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane) 
Harnessing the Power of Technology for the Warfighter

reply via email to

[Prev in Thread] Current Thread [Next in Thread]