From 4ac0628751137c34fae12fb3e5eff291e0cb1dc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
Date: Mon, 16 Dec 2019 17:31:04 +0200
Subject: [PATCH] dim: Refuse to push with leftover dim extract-tags marker
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Refuse the push if there are leftover markers from
dim extract-tags still present in the commit messages.

A few of these slipped through to drm-misc-next. Let's try
to avoid that in the future.

Cc: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 dim | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dim b/dim
index 1c2da80..42f0c87 100755
--- a/dim
+++ b/dim
@@ -99,6 +99,8 @@ dim_pull_request_recipients=(
 # integration configuration
 dim_integration_config=nightly.conf
 
+dim_extract_tags_marker="# *** extracted tags ***"
+
 #
 # Only function and alias definitions until the command line argument parsing
 # and subcommand handling at the end.
@@ -911,6 +913,12 @@ function checkpatch_commit_push
 		rv=1
 	fi
 
+	# check for leftover dim extract-tags marker
+	if git show -s $sha1 | grep -qF "$dim_extract_tags_marker" ; then
+		echoerr "$cite: leftover dim extract-tags marker."
+		rv=1
+	fi
+
 	if ! checkpatch_fixes_tag $sha1 ; then
 		rv=1
 	fi
@@ -1724,7 +1732,7 @@ function dim_extract_tags
 		return 0
 	fi
 
-	tags=$(printf -- "# *** extracted tags ***\n%s" "$tags")
+	tags=$(printf -- "$dim_extract_tags_marker\n%s" "$tags")
 
 	git filter-branch -f --msg-filter "cat ; echo \"$tags\"" $range
 }
-- 
GitLab