This is in preparation for hooking this rule to "check" at least in coreutils. Today I was burned once again by pushing a non-public submodule reference (coreutils). The fact that this check is currently run only at release time is good, but obviously not enough.
It probably belongs on a server-side commit hook, too. As a possible follow-on idea, ... So far, I don't see a down-side to adding this line to maint.mk: check: public-submodule-commit Does anyone else? >From b8fe4a63e97287b04750c1e713bd4502fdb63bae Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Thu, 20 Jan 2011 11:50:53 +0100 Subject: [PATCH] maint.mk: improve the public-submodule-commit rule * top/maint.mk (public-submodule-commit): Prefix with $(AM_V_GEN), to suppress printing of its commands... unless V=1. Add git submodule's --quiet option to suppress printing of e.g., "Entering gnulib" output. "cd" into $(srcdir) before running git submodule. --- ChangeLog | 9 +++++++++ top/maint.mk | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ca0e44..930eb14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-01-20 Jim Meyering <meyer...@redhat.com> + + maint.mk: improve the public-submodule-commit rule + * top/maint.mk (public-submodule-commit): Prefix with $(AM_V_GEN), + to suppress printing of its commands... unless V=1. + Add git submodule's --quiet option to suppress printing of e.g., + "Entering gnulib" output. + "cd" into $(srcdir) before running git submodule. + 2011-01-20 Bruno Haible <br...@clisp.org> Allow the user to avoid the GNULIB_TEST_* macros. diff --git a/top/maint.mk b/top/maint.mk index ae280f6..25f4736 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -1125,8 +1125,9 @@ submodule-checks ?= no-submodule-changes public-submodule-commit # cannot be built from a fresh clone. .PHONY: public-submodule-commit public-submodule-commit: - if test -d $(srcdir)/.git; then \ - git submodule foreach 'test $$(git rev-parse origin)' \ + $(AM_V_GEN)if test -d $(srcdir)/.git; then \ + cd $(srcdir) && \ + git submodule --quiet foreach 'test $$(git rev-parse origin)' \ = '"$$(git merge-base --independent origin $$sha1)"' \ || { echo '$(ME): found non-public submodule commit' >&2; \ exit 1; }; \ -- 1.7.3.5