Tue 07 Mar 2006 12:27:36 PM UTC, original submission:
Using cygwin command line client v1.11.17 on Windows XP, and server v1.11.18 on Linux (Red Hat AS 2.1)
We have a simple script that verifies commit messages, along the same principles as the short example in the Cederqvist (section C.4.2). This works fine for committing single files and multiple files in the same directory, and multiple text files in different directories, all at once.
However when committing several binary files in different directories at once, our script accepts all files in the first directory, but denies the checkin of all files in other directories. It seems as if CVS is not always passing on the commit comments to the script?
I've attached the CVS client logs of an example failed transaction.
Our commit script is as follows:
#!/bin/sh
#
# Verify that the CVS commit message contains a valid infra number
# (or the word "none") on the first line.
#
# Converted to use JIRA numbers.
#
# Jira: none
if sed 1q < "$1" | egrep -i '^jira:[[:space:]]*none$' > /dev/null; then
# It is okay to allow commits with 'Jira: none',
# but do not put that text into the real log message.
egrep -i -v '^jira:[[:space:]]*none$' "$1" > "$1.rewrite"
mv "$1.rewrite" "$1"
exit 0
#
# Jira: ABC-1234[,DEF-2222,GHI-3333...]
# (can have one or more JIRAs, separated by commas or whitespace)
#
elif sed 1q < "$1" | egrep -i '^jira:[[:space:]][[:alpha:]]{3}-[[:digit:]]+([[:space:],]+[[:alpha:]]{3}-[[:digit:]]+)$' > /dev/null; then
# force any text on the first line to be uppercase
sed 1y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/ < "$1" > "$1.rewrite"
mv "$1.rewrite" "$1"
exit 0
else
echo "No JIRA Numbers found."
exit 1
fi
|