[MERGED] libosmocore[master]: osmo-release.sh: Always generate entire commit changelog

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu May 3 14:21:24 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: osmo-release.sh: Always generate entire commit changelog
......................................................................


osmo-release.sh: Always generate entire commit changelog

Before this commit, for library projects (containing LIBVERSION in some
Makefile), the entire commit list was not stored into the changelog, but
only a few lines from TODO-RELEASE files.

This is a bad approach for several reasons. First, because that file was
only aimed at containing API/ABI breaks, and not the full relevant
changeset (like bugfixes, new features, etc.). Second, because it relies
on every developer making API/ABI changes to remember to store the
change in there during commit break time.

Let's instead always store the entire commit list in changelog, and
let's use TODO-RELEASE only as a list of hints for the maintainer to
help him evaluate how LIBVERSION needs to be bumped for each library.
Other tools such as osmo-abi-check.git can be used to help with the
process of decission too.

Let's take the opportunity too to only commit stuff already added to the
staging area, as it proved easier to manage from my personal experinece
making latest releases.

Change-Id: Ibf662173ce2b4ff3966e9ad5f56c65dfb13607ff
---
M TODO-RELEASE
M osmo-release.sh
2 files changed, 13 insertions(+), 19 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/TODO-RELEASE b/TODO-RELEASE
index 16496d6..146ab33 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -1,6 +1,6 @@
 # When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install
-# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
-# In short:
+# according to https://osmocom.org/projects/cellular-infrastructure/wiki/Make_a_new_release
+# In short: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
 # LIBVERSION=c:r:a
 # If the library source code has changed at all since the last update, then increment revision: c:r + 1:a.
 # If any interfaces have been added, removed, or changed since the last update: c + 1:0:0.
diff --git a/osmo-release.sh b/osmo-release.sh
index 0e85023..3b50ded 100755
--- a/osmo-release.sh
+++ b/osmo-release.sh
@@ -11,7 +11,7 @@
 
 NEW_VER=`bumpversion --list --current-version $VERSION $REL --allow-dirty | awk -F '=' '{ print $2 }'`
 LIBVERS=`git grep -n LIBVERSION | grep  '=' | grep am | grep -v LDFLAGS`
-MAKEMOD=`git diff -GLIBVERSION --stat | grep Makefile.am`
+MAKEMOD=`git diff --cached -GLIBVERSION --stat | grep Makefile.am`
 ISODATE=`date -I`
 
 if [ "z$BUMPVER" = "z" ]; then
@@ -26,28 +26,22 @@
 
 echo "Releasing $VERSION -> $NEW_VER..."
 
-if [ "z$LIBVERS" = "z" ]; then
-	gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch --new-version="$NEW_VER"
-else
-	echo "You should NOT be doing this unless you've read and understood following article:"
-	echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
-	grep -v '#' TODO-RELEASE | sed 's/\t\+/: /g' > TODO-RELEASE.entries
-	if [ "$(wc -l <TODO-RELEASE.entries 2>/dev/null)" -eq "0" ]; then
-		rm TODO-RELEASE.entries
-		echo "TODO-RELEASE must contain at least one line with change descriptions"
-		exit 1
-	fi
-	grep '#' TODO-RELEASE > TODO-RELEASE.clean
-	mv TODO-RELEASE.clean TODO-RELEASE
+if [ "z$LIBVERS" != "z" ]; then
 	if [ "z$MAKEMOD" = "z" ]; then
 		echo "Before releasing, please modify some of the libversions: $LIBVERS"
+		echo "You should NOT be doing this unless you've read and understood following article:"
+		echo "https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info"
 		exit 1
 	fi
-	xargs -a TODO-RELEASE.entries -r -d'\n' -I entry dch -m -v $NEW_VER "entry"
-	rm TODO-RELEASE.entries
+	if [ -f "TODO-RELEASE" ]; then
+		grep '#' TODO-RELEASE > TODO-RELEASE.clean
+		mv TODO-RELEASE.clean TODO-RELEASE
+		git add TODO-RELEASE
+	fi
 fi
+gbp dch --debian-tag='%(version)s' --auto --meta --git-author --multimaint-merge --ignore-branch --new-version="$NEW_VER"
 dch -r -m --distribution "unstable" ""
-git add -u
+git add debian/changelog
 bumpversion --current-version $VERSION $REL --tag --commit --tag-name $NEW_VER --allow-dirty
 git tag -s $NEW_VER -f -m "Release v$NEW_VER on $ISODATE."
 echo "Release $NEW_VER prepared, tagged and signed."

-- 
To view, visit https://gerrit.osmocom.org/7997
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf662173ce2b4ff3966e9ad5f56c65dfb13607ff
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list