Click to See Complete Forum and Search --> : CVS . . .


Evoluder
05-22-2002, 03:36 PM
I don't know if this is the best place for this (any CVS gurus around?) but I will ask anyways. I have just set up a CVS server here in our shop (which was amazingly simple and CVS rocks the house), but I have two questions :

1. Is there a way to make CVS "process" a file before it is actually "updated" (commit) back into the repository/module. One of my programmers is looking to run one of his "code formatters" on all of our Java source code as it goes back into the repository (so that everyone sees the same formatting).

2. Is there a way to make CVS force comments on commits? Right now it asks for a comment, but if you leave it blank it seems to be ok. I want CVS to refuse the commit until a comment is entered.

Any guidance on this would be great.

Spencer

Choozo
05-23-2002, 04:45 PM
Everything is possible, and I would look into some shell scripting as an 'overlay' to the cvs commands.

For example, create a shellscript 'cvs_commit' that takes the filename as an argument, and prompts the user for a mandatory comment, then executes the 'code formatter' on the file, and commits the file with the user comment.

There are a lot of shell scripting guides out there, and Google is a good way to start the search.
You could also find a few GUI frontends to CVS by searching freshmeat or sourceforge.

Cheers :)

Evoluder
05-23-2002, 04:54 PM
Yeah, I thought of that too, but I don't think something like that would work with the way things are set up here. Most of the developers are using some kind of IDE (IDEA, JDeveloper, whatever floats their boat) under WinXP and it is actually using the i386 port (cygwin) of CVS to interact with the repository. So I was just wondering if anyone knew of some built-in cvs function that'd let me do the post-processing of the files that get checked in (selective ones). Maybe I should go find a forum specific to CVS.

Choozo
05-23-2002, 04:59 PM
OK, sorry I wasn't able to figure out your setup from the original post ....

Evoluder
05-23-2002, 05:15 PM
My bad, should have been more specific. I actually think your idea might work so long as I can fool the IDE into using a batch file instead of the CVS executable. Unfortunately I think JDeveloper finds the executable on it's own and doesn't let you do anything like that. I might be able to trick it with some environment variable though. I dunno. I think I will post this on the CVS listserv and see what happens. Thanks for the input.

Spencer