[Cmake-commits] CMake branch, next, updated. v2.8.8-3507-g95a46a2

Brad King brad.king at kitware.com
Tue Jul 17 08:16:36 EDT 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  95a46a24e5bfe3afc1ec248dbd291da37c1aaa8c (commit)
       via  873f21ad1bcbf900025b7cbddb50b94b37d198aa (commit)
      from  a02e4bfe697e72306ca59e9e59f399ce0658878c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=95a46a24e5bfe3afc1ec248dbd291da37c1aaa8c
commit 95a46a24e5bfe3afc1ec248dbd291da37c1aaa8c
Merge: a02e4bf 873f21a
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 17 08:16:34 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jul 17 08:16:34 2012 -0400

    Merge topic 'hooks-line-length' into next
    
    873f21a pre-commit: Reject C++ code with lines too long


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=873f21ad1bcbf900025b7cbddb50b94b37d198aa
commit 873f21ad1bcbf900025b7cbddb50b94b37d198aa
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Jul 17 08:16:12 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Jul 17 08:16:12 2012 -0400

    pre-commit: Reject C++ code with lines too long
    
    Check changes in Source/*.h and Source/*.cxx for lines longer than
    our style limit.

diff --git a/Utilities/Git/pre-commit b/Utilities/Git/pre-commit
index 110e9ee..d308a81 100755
--- a/Utilities/Git/pre-commit
+++ b/Utilities/Git/pre-commit
@@ -19,6 +19,26 @@ die() {
   exit 1
 }
 
+#-------------------------------------------------------------------------------
+line_too_long=80
+bad=$(regex=".{$line_too_long}" &&
+git diff-index --cached HEAD --name-only --diff-filter=AM \
+    --pickaxe-regex -S"$regex" -- 'Source/*.h' 'Source/*.cxx' |
+while read file; do
+  lines_too_long=$(git diff-index -p --cached HEAD \
+                   --pickaxe-regex -S"$regex" -- "$file")
+  if echo "$lines_too_long" | egrep -q '^\+'"$regex"; then
+    echo "$lines_too_long"
+  fi
+done)
+test -z "$bad" ||
+die 'The following changes add lines too long for our C++ style:
+
+'"$bad"'
+
+Use lines strictly less than '"$line_too_long"' characters in C++ code.'
+
+#-------------------------------------------------------------------------------
 if test -z "$HOOKS_ALLOW_KWSYS"; then
   # Disallow changes to KWSys
   files=$(git diff-index --name-only --cached HEAD -- Source/kwsys) &&

-----------------------------------------------------------------------

Summary of changes:
 Utilities/Git/pre-commit |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list