Whamcloud - gitweb
LU-553 build: improve checks for commit-msg
authorAndreas Dilger <adilger@whamcloud.com>
Sat, 12 Nov 2011 19:23:49 +0000 (12:23 -0700)
committerJohann Lombardi <johann@whamcloud.com>
Mon, 21 Nov 2011 10:28:28 +0000 (05:28 -0500)
commit27e7ce7a2819fdea1ea2797c7b4b5a97944b7d88
treefd0a849363bbbafc4ce237887df2bcbae63cff5b
parent8089ee261a08a1bc38c214c90edae08e71cd7727
LU-553 build: improve checks for commit-msg

Improve the checks done by the commit-msg script.  It now ensures
that all the parts of the commit message are present.
- validate that the Change-Id: generated from 'git hash-object' is
  not empty, since this can happen if git is unhappy with the options
- check for only one Change-Id: line (multiple Signed-off-by: OK)
- describe the "component:" field better, with examples

If there was an error committing the message, save a copy to a
temporary file, so that it can be edited and re-used, instead of
having to recreate it each time, or fetch it from .git/COMMIT_MSG.

Add a simple regression test with good & bad commit messages, so
it is easier to verify that any changes made to the script will
continue to both detect errors, and pass valid commit messages.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9f954cd142a4b5cd9d596c7221cd3d6f73d8cf17
Merge-from: I15cb3690560400a591598997424cf79dee3a039d
Reviewed-on: http://review.whamcloud.com/1689
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
16 files changed:
build/autoMakefile.am.toplevel
build/commit-msg
build/commit.badcid [new file with mode: 0644]
build/commit.bademail [new file with mode: 0644]
build/commit.badname [new file with mode: 0644]
build/commit.badsign [new file with mode: 0644]
build/commit.dupcid [new file with mode: 0644]
build/commit.nobody [new file with mode: 0644]
build/commit.nocmp [new file with mode: 0644]
build/commit.nojira [new file with mode: 0644]
build/commit.nosign [new file with mode: 0644]
build/commit.nosum [new file with mode: 0644]
build/commit.ok_cid [new file with mode: 0644]
build/commit.ok_dupsign [new file with mode: 0644]
build/commit.ok_nocid [new file with mode: 0644]
build/test-commit-msg.sh [new file with mode: 0755]