]> code.delx.au - gnu-emacs/blobdiff - build-aux/git-hooks/pre-commit
Update copyright year to 2016
[gnu-emacs] / build-aux / git-hooks / pre-commit
index c24f9bb48d37d9ff02e69526e61f31f87f97bf6b..5a512442b18682e3650f46405d140b935e1eec1d 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Check file names in git commits for GNU Emacs.
 
-# Copyright 2014 Free Software Foundation, Inc.
+# Copyright 2014-2016 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -34,13 +34,15 @@ if test "$nbadchars" -ne 0; then
   exit 1
 fi
 
-new_names=`$git_diff HEAD` || exit
-case "
-$new_names" in
-  */-* | *'
-'-*)
-    echo "File name component begins with '-'."
-    exit 1;;
-esac
+for new_name in `$git_diff HEAD`; do
+  case $new_name in
+    -* | */-*)
+      echo "$new_name: File name component begins with '-'."
+      exit 1;;
+    ChangeLog | */ChangeLog)
+      echo "$new_name: Please use git commit messages, not ChangeLog files."
+      exit 1;;
+  esac
+done
 
 exec git diff-index --check --cached HEAD --