[Ffmpeg-cvslog] CVS: CVSROOT commitinfo,1.2,1.3 style.sh,1.1,1.2
Diego Biurrun CVS
diego
Tue Jan 24 01:27:46 CET 2006
Update of /cvsroot/ffmpeg/CVSROOT
In directory mail:/var2/tmp/cvs-serv11088
Modified Files:
commitinfo style.sh
Log Message:
The coding style enforcement script should now work with the CVS version
installed on mphq (famous last words)...
Index: commitinfo
===================================================================
RCS file: /cvsroot/ffmpeg/CVSROOT/commitinfo,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- commitinfo 13 Jan 2006 01:27:01 -0000 1.2
+++ commitinfo 24 Jan 2006 00:27:44 -0000 1.3
@@ -1,6 +1,6 @@
# The "commitinfo" file is used to control pre-commit checks.
-# The filter on the right is invoked with the repository and a list
-# of files to check. A non-zero exit of the filter program will
+# The filter on the right is invoked with the repository and a list
+# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
@@ -14,4 +14,4 @@
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-ALL $CVSROOT/CVSROOT/style.sh %{s}
+ALL $CVSROOT/CVSROOT/style.sh
Index: style.sh
===================================================================
RCS file: /cvsroot/ffmpeg/CVSROOT/style.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- style.sh 13 Jan 2006 01:27:01 -0000 1.1
+++ style.sh 24 Jan 2006 00:27:44 -0000 1.2
@@ -1,14 +1,31 @@
#!/bin/sh
#
-# Check committed files except Makefiles for tab characters
-# and abort the commit if they contain tabs.
+# Enforce some style guidelines on commits: Trailing whitespace and
+# tabs (outside of Makefiles) are forbidden.
-FILELIST="`echo $@ | sed s/Makefile//`"
+# CVS passes something like
+# /cvsroot/ffmpeg/ffmpeg.test <filename>
+# as parameter, filter out the module path.
+
+FILELIST="`echo $@ | cut -d' ' -f2-`"
for file in $FILELIST; do
- if grep -e ' ' -e ' $' $file > /dev/null; then
+ if grep -e ' $' -e ' $' $file > /dev/null; then
echo
- echo "Tabs or trailing whitespace found in $file."
+ echo "Trailing whitespace found in $file."
+ echo "Commit aborted, fix the issue and try again."
+ echo
+ exit 1
+ fi
+done
+
+#Makefiles may contain tabs.
+FILELIST="`echo $FILELIST | sed s/Makefile//`"
+
+for file in $FILELIST; do
+ if grep -e ' ' $file > /dev/null; then
+ echo
+ echo "Tabs found in $file."
echo "Commit aborted, fix the issue and try again."
echo
exit 1
More information about the ffmpeg-cvslog
mailing list