From: Jan Stancek <[email protected]>

redhat: check release commit is present for dist-{release-tag,git}

This is to prevent accidental tagging and dist-git updates when tree
is not in expected state - on release commit.

Signed-off-by: Jan Stancek <[email protected]>

diff --git a/redhat/Makefile b/redhat/Makefile
index blahblah..blahblah 100644
--- a/redhat/Makefile
+++ b/redhat/Makefile
@@ -809,7 +809,13 @@ dist-release: dist-clean-sources
 dist-get-tag: ##misc Returns the latest release tag.
        $(info $(DISTRELEASETAG))
 
-dist-release-tag:
+dist-check-release:
+       @if ! $(GIT) log -1 --format=%s | grep -q "\[redhat\] 
$(DISTRELEASETAG)"; then \
+               echo -e "Error: Check git tree, HEAD is expected to contain 
release commit."; \
+               exit 1; \
+       fi
+
+dist-release-tag: dist-check-release
        @$(GIT) tag -a -m "$(DISTRELEASETAG)" $(DISTRELEASETAG)
 
 git-tree-check:
@@ -867,7 +873,7 @@ _distg-brew _distg-koji: _distg-%: dist-vr-check
 dist-git-test: export RH_DIST_GIT_TEST="1"
 dist-git-test: dist-git
 
-dist-git: dist-srpm $(KABI_TARBALL) $(KABIDW_TARBALL)
+dist-git: dist-srpm $(KABI_TARBALL) $(KABIDW_TARBALL) dist-check-release
        @if [ -z "$(RHDISTGIT_BRANCH)" ]; then \
                echo "RHDISTGIT_BRANCH is unset"; \
                exit 1; \

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3733

-- 
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to