[postgis-tickets] [SCM] PostGIS branch master updated. 68d09a9aa24e6c6ad593cc531572f518f71d9cf1
git at osgeo.org
git at osgeo.org
Thu Dec 19 01:47:42 PST 2019
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 68d09a9aa24e6c6ad593cc531572f518f71d9cf1 (commit)
from 1378b633371931709bc10d2a08bfe12bd6f55afd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 68d09a9aa24e6c6ad593cc531572f518f71d9cf1
Author: Sandro Santilli <strk at kbt.io>
Date: Thu Dec 19 10:47:13 2019 +0100
Add --ticket-refs option to utils/check_news.sh
It's off by default because it doesn't pass at the moment
(missing ref to ticket #1003)
diff --git a/utils/check_news.sh b/utils/check_news.sh
index bac8f6f..cf13fed 100755
--- a/utils/check_news.sh
+++ b/utils/check_news.sh
@@ -2,24 +2,46 @@
RD=`dirname $0`/.. # root source dir
+usage() {
+ echo "Usage: $0 [-v] [--ticket-refs] [<sourcedir>]"
+ echo "Sourcedir defaults to one directory above this script"
+}
+
+
+### COMMAND LINE PARSING
VERBOSE=no
+TICKET_REFS=no
+while [ $# -gt 0 ]; do
+ if [ "$1" = "--help" ]; then
+ usage
+ exit 0
+ elif [ "$1" = "-v" ]; then
+ VERBOSE=yes
+ elif [ "$1" = "--ticket-refs" ]; then
+ TICKET_REFS="yes"
+ else
+ echo "ERROR: unrecognized extra argument $1" >&2
+ usage >&2
+ exit 1
+ fi
+ shift
+done
-if test "$1" = "-v"; then
- VERBOSE=yes
-fi
+
+cd ${RD}
# Extract dates from NEWS file and check they
# are sorted correctly
pdate=$(date '+%Y/%m/%d') # most recent timestamp
prel=Unreleased
-grep -B1 '^[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\}' ${RD}/NEWS |
+grep -B1 '^[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\}' NEWS |
while read rel; do
read date
read sep
ts=$( date -d "${date}" '+%s' )
pts=$( date -d "${pdate}" '+%s' )
if test $ts -gt $pts; then
- echo "${rel} (${date}) appears after earlier published release ${prel}"
+ echo "FAIL: ${rel} (${date}) appears after ${prel} (${pdate})" >&2
exit 1
fi
if test "${VERBOSE}" = yes; then
@@ -28,7 +50,28 @@ grep -B1 '^[0-9]\{4\}/[0-9]\{2\}/[0-9]\{2\}' ${RD}/NEWS |
pts=${ts}
prel=${rel}
done
+test $? = 0 || exit 1
+echo "PASS: NEWS file entries are in good order"
-echo "NEWS file entries are in good order"
+if test "${TICKET_REFS}" = "yes"; then
+ # If git is available, check that every ticket reference in
+ # commit logs is also found in the NEWS file
+ if which git > /dev/null && test -e .git; then
+ git log --grep '#[0-9]\+' |
+ grep -i ' #[0-9]\+' |
+ sed -En 's|#([0-9]+)|\a#\1\n|;/\n/!b;s|.*\a||;P;D' |
+ sort -u |
+ while read ref; do
+ if ! grep -qw '${ref}' NEWS; then
+ echo "FAIL: Reference to commit-logged ticket ref ${ref} missing from NEWS" >&2
+ exit 1
+ fi
+ done
+ test $? = 0 || exit 1
+ echo "PASS: All ticket references in commits log found in NEWS"
+ else
+ echo "SKIP: GIT history cannot be checked (missing git or missing ${RD}/.git)"
+ fi
+fi
exit 0
-----------------------------------------------------------------------
Summary of changes:
utils/check_news.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 49 insertions(+), 6 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list