Преглед изворни кода

HPCC-8491 Git hook giving spurious errors about line length

The githook that checks line length can be triggered by long filenames in the
comments about untracked files.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman пре 12 година
родитељ
комит
253a67d092
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      githooks/commit-msg

+ 1 - 1
githooks/commit-msg

@@ -38,7 +38,7 @@ Use git commit -s -t $1 to reopen previous message for editing\n"
   exit 1
 }
 
-[ $(cat "$1" | wc -L ) -le 80 ] || {
+[ $(grep -v '^#' "$1" | wc -L ) -le 80 ] || {
   echo >&2 "\n ERROR: Commit message lines too long (max 80 chars)."
   echo >&2 $usage
   exit 1