473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Short program to dis-allow CVS commits if no comment is supplied

Granted this only stopps the "forgetfull".

I tested it against the following clients, all of which supply a
DIFFERENT "no message" string.

WinCVS 1.3.14.1 Beta 14 ( Build 1 )
TortioseCVS
some MacClient
Eclipse 3.0 ( cvs built in client )

add this file to $CVSROOT/CVSROOT/checkoutlist

then add

..* $CVSROOT/CVSROOT/CVSRequireComment.py

to $CVSROOT/CVSROOT/verifymsg


# Filename = CVSRequireComment.py

#!/usr/bin/env python

import sys

def main():
# // args[0] is script name
# // args[1] is temp file name
# // stdin contains long log message from cvs

# // these are for debugging what is actually being suppiled
# // to this script
#sys.stderr.write( 'sript name = ' + sys.argv[0] + '\n' )
#sys.stderr.write( 'message temp file = ' + sys.argv[1] + '\n' )
#sys.stderr.write( 'stdin = "' + sys.stdin.read() +
'"\n' )

try:
logString = open( sys.argv[1] ).read()
logString = logString.strip()
#sys.stderr.write( 'logString = "' + logString + '"' )
except:
sys.stderr.write('No log message file found')

# // don't allow commits to files of the following type
if logString.find( '.class'):
sys.stderr.write( '.class files are not allowed in the
repository' )
sys.exit(1);
# // this is what WinCVS sends in when no message is supplied
# // version 1.3.14.1 Beta 14 Build 1 actually sends in 'no
message\n'
# // so I decided to do startswith() to handle the case if the \n
gets removed
# // eclipse's integrated cvs support uses '*** empty log message
**'
# // so again I use startswith() to detect those
# // tortoise just sends in a carrige return or line feed or
something
# // that is what the logString.strip() is for above
if ( logString.startswith( 'no message' ) ) or (
logString.startswith( '***' ) ) or ( not logString ) or ( len(
logString ) == 0 ):
sys.stderr.write('No comment was suppiled\n')
sys.stderr.write('You must supply a ** useful ** comment!\n' )
sys.stderr.write('A concise explaination of what was done or a
bug id is ok\n')
sys.exit(1)
else:
#sys.stderr.write( 'Thanks for supplying a comment' )
#sys.stderr.write('Comment == "' + logString + '"\n')
sys.exit(0)

if __name__ == "__main__":
main()
Jul 18 '05 #1
0 1115

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kay Schluehr | last post by:
In mathematics two functions can be considered equal when they represent the same function graph. This is nothing but a set-theoretical identity. It is a nice criterion in theory bad a bad one in...
5
by: Ron Adam | last post by:
Can anyone show me an example of of using dis() with a traceback? Examples of using disassemble_string() and distb() separately if possible would be nice also. I'm experimenting with...
99
by: Glen Herrmannsfeldt | last post by:
I was compiling a program written by someone else about six years ago, and widely distributed at the time. It also includes makefiles for many different systems, so I know it has been compiled...
34
by: Andy | last post by:
Hi, Are 1 through 4 defined behaviors in C? unsigned short i; unsigned long li; /* 32-bit wide */ 1. i = 65535 + 3; 2. i = 1 - 3; 3. li = (unsigned long)0xFFFFFFFF + 3; 4. li = 1...
1
by: Paul Edwards | last post by:
I have the following C program: #include <stdio.h> int main(void) { unsigned short x = 32768, y=16384; if (x > y) {
14
by: CapCity | last post by:
If I have a strig that represents a path, how can I programmatically get the "short" DOS name for it? For example, if I have "C:\Program Files\" I want "C:\Progra~1\". Thanks
7
by: kannushree | last post by:
i have built a program ,that checks wheteher a date is valid or not. now if i want to add date,month year (in same input) to a particular date,,how wud the logic work? it should be like dis : void...
2
by: CptDondo | last post by:
I'm trying to write what should be a simple program, and it keeps hanging if I use volatile.... The program, stripped of its error checking, is this: unsigned short * start; unsigned short *...
3
by: swethasuresh | last post by:
helloo im swetha working in a software company and im a fresher so i got a problem in asp with vb.net program.. kindly solve my problem..in dis below program there is a error coming at execute non...
6
by: Gernot Frisch | last post by:
Hi, the program below workes w/o problems on a GP2X and on the PC, but my PocketPC (using GCC 3.3.3) crashes. Very dissapointing, since I expect some speed boost from it. Thnak you for your...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.