Pre-Commit Hook check to check for newer version
authorRoland Knall <roland.knall@br-automation.com>
Thu, 13 Mar 2014 13:28:43 +0000 (14:28 +0100)
committerAlexis La Goutte <alexis.lagoutte@gmail.com>
Thu, 13 Mar 2014 14:46:36 +0000 (14:46 +0000)
 Insert a short check to always check for newer versions
 in the tool directory of the pre-commit script

 So far, only a warning is being generated, allowing the
 developer to decide for him/herself

Change-Id: I6fce60e3de1d051757d0ed38eae8fdc94cec7662
Reviewed-on: https://code.wireshark.org/review/633
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
tools/pre-commit

index 46fe838655a706d627f971bbd9356823f8a5d84b..234b6c5a9def8f517a389cf71bc46da0e931a327 100755 (executable)
 # If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample)
 exec git diff-index --check --cached HEAD
 
+# Check for newer versions of the pre-commit script
+if [ ./.git/hooks/pre-commit -ot ./tools/pre-commit ] ; then
+    echo "Pre-commit hook script is outdated, please update!"
+fi
+
 for FILE in `git diff-index --cached --name-only HEAD` ; do
     #Exit immediately if a command exits with a non-zero status.
     set -e