diff options
author | Jim Meyering <meyering@fb.com> | 2016-08-12 11:17:26 -0700 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2016-08-13 21:56:16 -0700 |
commit | b3def738f3b435cbe6f2a8406bae5a71175a0b80 (patch) | |
tree | a984782eeab1f99f25a5bf7950cc6f71fbbf67fd /bootstrap.conf | |
parent | 1a0df4396ebe3b9a58b882bb976cfce3f50d3cac (diff) | |
download | diffutils-b3def738f3b435cbe6f2a8406bae5a71175a0b80.tar.gz |
maint: require that commit messages be of a certain form
* bootstrap.conf (bootstrap_epilogue): Merge from coreutils, so that
a local commit hook will now help enforce consistent commit messages.
* Makefile.am (check-git-hook-script-sync): New rule, largely copied
from coreutils.
* scripts/git-hooks/commit-msg: New file, from coreutils, but
with adapted list of program names.
* scripts/git-hooks/applypatch-msg: New file, from git.
* scripts/git-hooks/pre-applypatch: Likewise.
* scripts/git-hooks/pre-commit: Likewise.
Diffstat (limited to 'bootstrap.conf')
-rw-r--r-- | bootstrap.conf | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bootstrap.conf b/bootstrap.conf index 828ffef..ac3c278 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -129,4 +129,29 @@ bootstrap_post_import_hook() bootstrap_epilogue() { perl -pi -e "s/\@PACKAGE\@/$package/g" README-release + + # Since this is a "GNU" package, replace this line + # if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null \ + # | grep -v 'libtool:' >/dev/null; then + # with this: + # if true; then + # Why? That pipeline searches all files in $(top_srcdir), and if you + # happen to have large files (or apparently large sparse files), the + # first grep may well run out of memory. + perl -pi -e 's/if LC_ALL=C grep .GNU .PACKAGE.*; then/if true; then/' \ + po/Makefile.in.in + + # Install our git hooks, as long as "cp" accepts the --backup option, + # so that we can back up any existing files. + case $(cp --help) in *--backup*) backup=1;; *) backup=0;; esac + if test $backup = 1; then + hooks=$(cd scripts/git-hooks && git ls-files) + for f in $hooks; do + # If it is identical, skip it. + cmp scripts/git-hooks/$f .git/hooks/$f > /dev/null \ + && continue + cp --backup=numbered scripts/git-hooks/$f .git/hooks + chmod a-w .git/hooks/$f + done + fi } |