Skip to content
This repository
Newer
Older
100755 45 lines (42 sloc) 1.865 kb
7b7bbad7 »
2010-03-17 Add a commit-msg hook that checks that all commits have the Signed-of…
1 #!/bin/bash
2 #
3 # Copyright (c) 2010, Benjamin C. Meyer <ben@meyerhome.net>
4 # All rights reserved.
5 #
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are met:
8 # 1. Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # 2. Redistributions in binary form must reproduce the above copyright
11 # notice, this list of conditions and the following disclaimer in the
12 # documentation and/or other materials provided with the distribution.
6abef8eb »
2010-06-19 Change license of all code from the 4 clause license to the 3 clause …
13 # 3. Neither the name of the project nor the
7b7bbad7 »
2010-03-17 Add a commit-msg hook that checks that all commits have the Signed-of…
14 # names of its contributors may be used to endorse or promote products
15 # derived from this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER ''AS IS'' AND ANY
18 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
21 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 #
28
29 function run_test
30 {
31 grep '^Signed-off-by: ' "${1}" >/dev/null || {
32 echo "The commit message must have a Signed-off-by line."
33 exit 1
34 }
35 }
36
37 case "${1}" in
38 --about )
ab4c30e6 »
2011-12-11 Fix --about for signed-off-by hook.
39 echo -n "Checks commit message for presence of Signed-off-by line."
7b7bbad7 »
2010-03-17 Add a commit-msg hook that checks that all commits have the Signed-of…
40 ;;
41 * )
42 run_test "$@"
43 ;;
44 esac
Something went wrong with that request. Please try again.