github.com/trevoraustin/hub@v2.2.0-preview1.0.20141105230840-96d8bfc654cc+incompatible/git-hooks/commit-msg.sh (about)

     1  #!/bin/bash
     2  ## Checks that commit that changes version number includes it in subject line.
     3  
     4  set -e
     5  
     6  new_version="$("$(dirname "$0")"/changed-version)" || exit 0
     7  
     8  head -1 "$1" | grep "$new_version" >/dev/null || {
     9    echo "aborted: version $new_version not present in subject line"
    10    exit 1
    11  }