[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated (f9773ea41 -> 19ae88bae)
From: |
gnunet |
Subject: |
[gnunet] branch master updated (f9773ea41 -> 19ae88bae) |
Date: |
Wed, 18 Jan 2023 05:56:21 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a change to branch master
in repository gnunet.
from f9773ea41 -bump Debian package
new c22526874 build: update git hooks logic
new 30d8e2523 build: update git hooks again and fix autmatic installation
on bootstrap
new 884eb205f build: change changelog scripts to NEWS.
new 426ae19f9 Merge branch 'master' of git+ssh://git.gnunet.org/gnunet
new 19ae88bae build: rename changelog update scripts to news
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
NEWS | 3 ++-
bootstrap | 11 +++++++++--
contrib/conf/commit-msg | 34 ++++++++++++++++++++++++++++++++
contrib/conf/prepare-commit-msg | 39 +++++++++++++++++++++++++++++++++++++
contrib/scripts/changelog_delta.sh | 18 -----------------
contrib/scripts/news_delta.sh | 6 ++++++
contrib/scripts/update_changelog.sh | 10 ----------
contrib/scripts/update_news.sh | 15 ++++++++++++++
8 files changed, 105 insertions(+), 31 deletions(-)
create mode 100755 contrib/conf/commit-msg
create mode 100755 contrib/conf/prepare-commit-msg
delete mode 100755 contrib/scripts/changelog_delta.sh
create mode 100755 contrib/scripts/news_delta.sh
delete mode 100644 contrib/scripts/update_changelog.sh
create mode 100644 contrib/scripts/update_news.sh
diff --git a/NEWS b/NEWS
index 898a3dab3..746ec2884 100644
--- a/NEWS
+++ b/NEWS
@@ -1 +1,2 @@
-See ChangeLog.
+v0.19.2 (e9bc4c898):
+ - New changelog format origin
\ No newline at end of file
diff --git a/bootstrap b/bootstrap
index 9c830d471..69f2cc863 100755
--- a/bootstrap
+++ b/bootstrap
@@ -40,8 +40,8 @@ check_uncrustify()
{
if existence uncrustify; then
echo "Installing uncrustify hook and configuration"
- ln -fs contrib/conf/uncrustify.cfg uncrustify.cfg 2> /dev/null
- ln -fs contrib/conf/uncrustify_precommit .git/hooks/pre-commit 2>
/dev/null
+ ln -fs $(pwd)/contrib/conf/uncrustify.cfg uncrustify.cfg 2> /dev/null
+ ln -fs $(pwd)/contrib/conf/uncrustify_precommit .git/hooks/pre-commit
2> /dev/null
else
echo "Uncrustify not detected, hook not installed."
echo "Please install uncrustify if you plan on doing development"
@@ -173,6 +173,12 @@ gana_update()
echo "GANA finished"
}
+install_hooks()
+{
+ ln -fs $(pwd)/contrib/conf/prepare-commit-msg .git/hooks/prepare-commit-msg
2> /dev/null
+ ln -fs $(pwd)/contrib/conf/commit-msg .git/hooks/commit-msg 2> /dev/null
+}
+
main()
{
cleanup
@@ -182,6 +188,7 @@ main()
check_uncrustify
check_yapf
check_libtool
+ install_hooks
}
main "$@"
diff --git a/contrib/conf/commit-msg b/contrib/conf/commit-msg
new file mode 100755
index 000000000..f6e73d5cc
--- /dev/null
+++ b/contrib/conf/commit-msg
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# use as .git/hooks/commit-msg
+
+COMMIT_MSG_FILE=$1
+
+exec 1>&2
+
+RET=0
+changed=$(git diff --cached --name-only)
+
+for f in $changed;
+do
+ # Only headers in include
+ if echo $f | grep \src\/include\/.\*\.h\$ > /dev/null
+ then
+ RET=1
+ # Check if it has a ChangeLog line
+ if cat $COMMIT_MSG_FILE | grep -i "^NEWS:\s[-,a-zA-Z][a-zA-Z]*" > /dev/null
+ then
+ RET=0
+ break
+ fi
+ fi
+done
+
+# If no ChangeLog line found, abort
+if [ $RET = 1 ];
+then
+ echo "Your commit includes staged changes that indicate an API change which
requires a ChangeLog line."
+else
+ echo "Your commit does not include API changes"
+fi
+exit $RET
diff --git a/contrib/conf/prepare-commit-msg b/contrib/conf/prepare-commit-msg
new file mode 100755
index 000000000..0266f5558
--- /dev/null
+++ b/contrib/conf/prepare-commit-msg
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# use as .git/hooks/pre-commit
+
+COMMIT_MSG_FILE=$1
+COMMIT_SOURCE=$2
+SHA1=$3
+
+exec 1>&2
+
+RET=0
+changed=$(git diff --cached --name-only)
+
+for f in $changed;
+do
+ # Only headers in include
+ if echo $f | grep \src\/include\/.\*\.h\$ > /dev/null
+ then
+ RET=1
+ fi
+done
+
+# Only add custom message when there is no commit source
+# ($COMMIT_SOURCE is empty). Otherwise, keep the default message
+# proposed by Git. Possible commit source: message, template,
+# merge, squash or commit.
+if [ -z "$COMMIT_SOURCE" ];
+then
+ hint=$(cat "$COMMIT_MSG_FILE")
+ echo ": Fixes #" > "$COMMIT_MSG_FILE"
+ echo -e "# Our commit subject format policy is:\n# <subsystem>:
<description>\n# Adding 'Issue #1234'/'Fixes #1234' into the description will
automatically update/resolve issue #1234 in mantis." >> "$COMMIT_MSG_FILE"
+ if [ $RET = 1 ];
+ then
+ echo -e "\n# Your commit includes staged changes that indicate an API
change which requires a ChangeLog line." >> "$COMMIT_MSG_FILE"
+ echo "NEWS: " >> "$COMMIT_MSG_FILE"
+ fi
+ echo "$hint" >> "$COMMIT_MSG_FILE"
+fi
+exit 0
diff --git a/contrib/scripts/changelog_delta.sh
b/contrib/scripts/changelog_delta.sh
deleted file mode 100755
index 988434903..000000000
--- a/contrib/scripts/changelog_delta.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-if [ $2 == "plain" ]; then
- FORMAT=" - %s%n%b"
- echo "Changes since $1:"
-elif [ $2 == "html" ]; then
- FORMAT=" <li>%s<br>%b</li>"
- echo "<ul>"
-elif [ $2 == "changelog" ]; then
- FORMAT="%aD (%h)%n%s%n%b%nby: %cN%n"
-fi
-
-git --no-pager log --grep="^[a-zA-Z]*: " --no-merges --no-color
--format="$FORMAT" $1..HEAD
-
-if [ $2 == "html" ]; then
- echo "</ul>"
-fi
-
-
diff --git a/contrib/scripts/news_delta.sh b/contrib/scripts/news_delta.sh
new file mode 100755
index 000000000..20fb98649
--- /dev/null
+++ b/contrib/scripts/news_delta.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+OLDVERSION=$1
+
+git --no-pager log --grep="^NEWS: " -i --no-merges --no-color
--format="%s%n%b" $1..HEAD | grep -i "^NEWS:\s[a-zA-Z][a-zA-Z]*" | sed
's/NEWS:/ -/i'
+echo ""
diff --git a/contrib/scripts/update_changelog.sh
b/contrib/scripts/update_changelog.sh
deleted file mode 100644
index 988ca6490..000000000
--- a/contrib/scripts/update_changelog.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-DELTA_SH="contrib/scripts/changelog_delta.sh"
-LASTHASH=$(head -n1 ChangeLog | cut -d " " -f 7 | tr -d \( | tr -d \))
-
-$DELTA_SH $LASTHASH changelog > ChangeLog.delta || exit 1
-cp ChangeLog ChangeLog.bak || exit 1
-cat ChangeLog.delta > ChangeLog || exit 1
-cat ChangeLog.bak >> ChangeLog || exit 1
-rm ChangeLog.bak ChangeLog.delta
-
diff --git a/contrib/scripts/update_news.sh b/contrib/scripts/update_news.sh
new file mode 100644
index 000000000..2ee5fa3dc
--- /dev/null
+++ b/contrib/scripts/update_news.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+NEW_VERSION=$1
+if [ -z $NEW_VERSION ]; then
+ NEW_VERSION="Unreleased"
+fi
+DELTA_SH="contrib/scripts/news_delta.sh"
+LASTHASH=$(head -n1 NEWS | cut -d " " -f 2 | tr -d \( | tr -d \) | tr -d :)
+
+echo "$NEW_VERSION ($(git rev-parse --short HEAD)):" > NEWS.delta || exit 1
+$DELTA_SH $LASTHASH >> NEWS.delta || exit 1
+cp NEWS NEWS.bak || exit 1
+cat NEWS.delta > NEWS || exit 1
+cat NEWS.bak >> NEWS || exit 1
+rm NEWS.bak NEWS.delta
+
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] branch master updated (f9773ea41 -> 19ae88bae),
gnunet <=
- [gnunet] 02/05: build: update git hooks again and fix autmatic installation on bootstrap, gnunet, 2023/01/17
- [gnunet] 04/05: Merge branch 'master' of git+ssh://git.gnunet.org/gnunet, gnunet, 2023/01/17
- [gnunet] 03/05: build: change changelog scripts to NEWS., gnunet, 2023/01/17
- [gnunet] 01/05: build: update git hooks logic, gnunet, 2023/01/17
- [gnunet] 05/05: build: rename changelog update scripts to news, gnunet, 2023/01/17