info-cvs
[Top][All Lists]
Advanced

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

Re: Accessing CVS files during commit (via a script)


From: Mark
Subject: Re: Accessing CVS files during commit (via a script)
Date: Mon, 16 Jul 2001 11:31:13 -0700 (PDT)

I just did some testing, and modifying the server tmp copies is a real bad
idea, like Dennis said. But it is good that CVS makes the to-be-commited files
available (whether or not by design) to the trigger scripts.

CVS doesn't have precommit triggers and I (personally) don't like tools that
have client side triggers.

If you are trying to enforce coding syntax/policy, have your trigger do want it
needs to do on a copy of the server tmp files, then compare the resultant files
the tmp files server will commit. If they are any differences, reject the
commit and tell the user to run the beautifier prior to commit.

Mark

--- Dennis Jones <address@hidden> wrote:
> Mark,
> 
> Is this really a good idea?  If you do what you are proposing, after you
> commit a file, changes will be made to the file (unbeknownst to you) and I
> suspect your local copy will immediately be out of date, even though you
> just committed it!  So, a question I have is, will CVS *know* that the file
> is out of date?  I don't know how CVS works in this regard...does it get a
> copy of the file from the repository immediately following a commit?
> Perhaps a CVS expert can shed some light on this question.
> 
> CVS must do *something* at this point though, because it has to modify any
> keywords you have in your file (such as $Id) after the commit, but I suspect
> that they are modified directly by the client.  If this is the case, then
> you will almost surely have trouble with files being out of date and CVS not
> knowing that this is the case.  It is also possible that an update might not
> even help -- if CVS thinks the file is already updated!
> 
> So, my next question is, why not run the code through the beautifier PRIOR
> to the commit?  Then you will be sure your files are up to date after the
> commit, and anyone else that checks out (or updates) the file will get the
> beautified copy.
> 
> - Dennis
> 
> ----- Original Message -----
> From: "Mark McDonald" <address@hidden>
> To: "Mark" <address@hidden>; <address@hidden>
> Sent: Monday, July 16, 2001 8:39 AM
> Subject: Re: Accessing CVS files during commit (via a script)
> 
> 
> > Hi Mark,
> >
> > Thanks for the response. I know how to get the
> > variables though, what I am trying to do is actually
> > open up the files that are being committed.
> >
> >  So for example, suppose you wanted to run a code
> > beautifier on the script/file being committed within
> > cvs. You would then need access to the incoming file
> > that cvs has just received.
> >
> > I guess what I am asking is if this is possible. The
> > 'Open Source Development Book with CVS' claims that
> > you can do this --but gives no examples as to how to
> > do it.
> >
> > Any help is totally appreciated!
> >
> > -Mark McDonald
> >
> >
> > # perl this_script  /cvsroot/mod_perl_config
> > startup.perl
> > #                            |                   |
> > #                      the CVSROOT/module      the
> > modified file
> > #
> >
> > # perl this_script
> > /cvsroot/mod_perl_config/db_connections
> > mikey.connection web_dev.connection
> > #                             |
> >           |                  |
> > #                         the module/sub-dir
> >        mod file 1         mod file 2
> >
> >
> > --- Mark <address@hidden> wrote:
> > >
> > > Ask CVS....
> > >
> > > create a trigger script to ask questions and find
> > > out the trigger's runtime
> > > environemnt...
> > >
> > > things to include might be...
> > >
> > > print "@ARGV";
> > > print "$0,$1,$2.....";
> > > pwd;
> > > ls -Rla;
> > > env;
> > >
> > > that's how I found out (with pserver anyhow)
> > >
> > > Mark
> > >
> > > --- Mark McDonald <address@hidden> wrote:
> > > > Does anyone know how this works?!
> > > >
> > > >
> > > > > I am using the CVS Open Source Development book
> > > as a
> > > > reference to make a
> > > > > script that will run upon a cvs commit.
> > > Basically
> > > > what
> > > > > I am trying to do is open up the file that is
> > > being
> > > > > committed to a repository.
> > > > >
> > > > > On page 132 of the CVS book (in the top note
> > > > section)
> > > > > this book states that '
> > > >
> > > >   the file names passed to the program
> > > > > do not refer to the RCS files --they point to
> > > normal
> > > > > files, whose contents are exactly the same as
> > > the
> > > > > working-copy files being committed. The only
> > > unusual
> > > > > aspect is that CVS has them temporarily places
> > > > inside
> > > > > the repository, so they'll be available to the
> > > > > programs running on the machine where the
> > > repository
> > > > > is located.'
> > > > >
> > > > >
> > > > > I have basically tried everything to locate
> > > these
> > > > > files so I can do things with them. In this case
> > > I
> > > > am
> > > > > trying to copy the contents to webservers on
> > > this
> > > > and
> > > > > other networks.
> > > > >
> > > > > I have check the news groups and CVS's homepage
> > > > > in search of this info. Perhaps you could give
> > > me a
> > > > > tip!
> > > > >
> > > > > Anything about where I can find and open these
> > > files
> > > > > would be helpful!
> > > > >
> > > > > Thanks in advance!
> > > >
> > > > Please email (or cc) me directly as I am not a
> > > member
> > > > of this group!
> > > > >
> > > > >-- MMD
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Get personalized email addresses from Yahoo! Mail
> > > > http://personal.mail.yahoo.com/
> > > >
> > > > _______________________________________________
> > > > Info-cvs mailing list
> > > > address@hidden
> > > > http://mail.gnu.org/mailman/listinfo/info-cvs
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Get personalized email addresses from Yahoo! Mail
> > > http://personal.mail.yahoo.com/
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
> >
> > _______________________________________________
> > Info-cvs mailing list
> > address@hidden
> > http://mail.gnu.org/mailman/listinfo/info-cvs
> 
> 
> _______________________________________________
> Info-cvs mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/info-cvs


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



reply via email to

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