[cvsnt] Re: commitinfo questions

emre erdogan emre.eerdogan at gmail.com
Fri May 27 09:07:15 BST 2005


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


On 5/26/05, Dianne Chen <diana_chen23 at yahoo.com> wrote:
> Hi!
> 
> I am using cvsnt 2.0.58d on RHEL3.0 server. I am
> trying to use commitinfo utility to catch bad
> filenames being created (i.e. spaces in them). Can
> someone please provide a bit of information? I have
> searched mail archives and not found all my answers.
> 
> 1) In commitinfo, the following line does not work
> right for me:
> ALL ~me/bin/chk_spaces %{sVv}
I think, in commitinfo you can not use the parameters %v and %V. Default
pattern, as it says in the manual is, [%r/%p %<s] which explains why you have
repo-name/directory of the commit in your log file, and the string %{sVv} -> cvs
can not understand this in commitinfo I guess.
> (for now, chk_spaces echos all passed parameters to a
> logfile so I can see what is happening)
> 
> After doing a commit, my log file contain %{sVV} and
> the repo-name/directory of the commit. Calling
> chk_spaces rountine with no arguments returns the
> repo-name/directory only. Is this expected? How do  I
> get the name of the file being committed?

So you can get the list of file names by using ONLY the %s parameter. Pass 
this one into your batch file and you shall have "aFile, anotherFile,
...." string for
each file to be committed.

> 2) Commitinfo only works at "commit" time. A bad
> filename can be "added" and not caught at add-time.
> Yes? 

Yes

> Q: Are there any "add time" trigger methods? 

I do not know, but I hope there is....Does anyone know this?

> Q: It looks like "adding" only puts line in
> CVS/entries file with "dummy timestamp". Someone can
> add a file with blanks in the name, cvsnt will accept,
> and then when commit is requested, only then will
> cvsnt reject the commit. Is this correct?

I would say, yes, but not sure.

> Q: If developer adds a bad filename, then tries to
> commit and is told they cannot commit with blanks in
> filename, and they change filename, readd, and then
> commit successfully, the CVS/entries file still
> contains the bad named file with "dummy timestamp
> entry". Will this cause problems?

In each up command, cvs will complain that there is a file added but not
committed. But I do not know if there are any other complications.

> 3) Is there easier way? Has someone already created
> commitinfo util that prevents "bad filenames"?

I, myself is working on something similar. I have tried to solve my
problem using
a loginfo script (which gets executed after the commit by the way) but
there is a problem with %s parameter here. When this parameter is used
in loginfo scripts, CVS seems to crash when a new folder is added 
(cvs add anewfolder). I have asked this question to the list, but no
one has answered so any help is appreciated.

> Thank you for any information you can provide.

Another idea that comes to my mind is to use a PRECOMMAND script
together with commitinfo maybe. This one will be executed before each
command and you will have %c parameter that will give you which
command is being executed. You can probably check this and if it is an
"add" you can validate the rest of the command line (%a) for file or
folder names with spaces.

> DC
> 
>  
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> cvsnt mailing list
> cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
> http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs
>



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook