diff options
author | Jim Meyering <meyering@redhat.com> | 2011-10-20 17:26:01 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-10-23 11:44:40 +0200 |
commit | 2ade806cf5740fa0ef0f7211699e5b4e7ce90464 (patch) | |
tree | 680c13ce1d723e22b965953a696998ccc69a21ef /cfg.mk | |
parent | d191bfe8a688d40aac0e3626b434b54ddbafd072 (diff) | |
download | coreutils-2ade806cf5740fa0ef0f7211699e5b4e7ce90464.tar.xz |
maint: add git hook scripts
We find it worthwhile to use consistent commit summary prefixes.
To that end, the commit-msg script requires that all commits I make
start with "$P: " (where $P is one of ~100 programs in coreutils)
or one of a few other words, like gnulib tests maint doc build.
It allows more than one word, so e.g., "cat tail head: " would also
be accepted. Pádraig Brady wrote the initial version, with its
72-column and blank-if-present second line checks.
The pre-commit script is the same as the git-supplied sample script,
modulo a bug fix and the "exec 1>&2" redirection.
* scripts/git-hooks/commit-msg: New file.
* scripts/git-hooks/pre-commit: New file.
* scripts/git-hooks/applypatch-msg: New file. Verbatim from .sample.
* cfg.mk: Exempt two of the new scripts from the no-leading-TABs check,
since they're nearly verbatim from git, and we want to stay in sync.
Exempt the commit-msg script from the no-"fail=0" check.
Diffstat (limited to 'cfg.mk')
-rw-r--r-- | cfg.mk | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -384,13 +384,15 @@ exclude_file_name_regexp--sc_file_system = \ exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \ ^m4/stat-prog\.m4$$ exclude_file_name_regexp--sc_prohibit_fail_0 = \ - (^tests/init\.sh|Makefile\.am|\.mk)$$ + (^scripts/git-hooks/commit-msg|^tests/init\.sh|Makefile\.am|\.mk)$$ exclude_file_name_regexp--sc_prohibit_atoi_atof = ^lib/euidaccess-stat\.c$$ + +tbi_1 = ^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$ +tbi_2 = ^scripts/git-hooks/(pre-commit|applypatch-msg)$$ exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \ - ^tests/pr/|(^gl/lib/reg.*\.c\.diff|Makefile(\.am)?|\.mk|^man/help2man)$$ + $(tbi_1)|$(tbi_2) + exclude_file_name_regexp--sc_preprocessor_indentation = \ ^(gl/lib/rand-isaac\.[ch]|gl/tests/test-rand-isaac\.c)$$ - - exclude_file_name_regexp--sc_prohibit_stat_st_blocks = \ ^(src/system\.h|tests/du/2g)$$ |