[PATCH 1/2] dim: Unify tag handling

Daniel Vetter daniel.vetter at ffwll.ch
Fri Dec 1 09:03:19 UTC 2017


Just prep work. Well, result is that the tag template is also used for
drm-intel-next tags.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/dim b/dim
index 8b8621d157b2..c1a8137f2af3 100755
--- a/dim
+++ b/dim
@@ -1569,7 +1569,7 @@ function dim_update_next_continue
 		tag_testing="drm-intel-testing-$dim_today-$((++suffix))"
 	done
 
-	$DRY git tag -a $DIM_GPG_KEYID $tag $intel_remote/drm-intel-next
+	tag_branch $tag drm-intel-next
 	git push $DRY_RUN $intel_remote $tag
 
 	echo "Updating drm-intel-testing to latest drm-tip"
@@ -1609,7 +1609,7 @@ function dim_tag_next
 			tag="drm-intel-next-$dim_today-$((++suffix))"
 		done
 
-		$DRY git tag -a $DIM_GPG_KEYID $tag $intel_remote/drm-intel-next
+		tag_branch $tag drm-intel-next
 		git push $DRY_RUN $intel_remote $tag
 	else
 		echo "drm-intel-next not up-to-date, aborting"
@@ -1618,7 +1618,7 @@ function dim_tag_next
 
 }
 
-function prep_pull_tag_summary
+function tag_summary
 {
 	if [ -r $DIM_TEMPLATE_TAG_SUMMARY ]; then
 		cat $DIM_TEMPLATE_TAG_SUMMARY
@@ -1636,6 +1636,16 @@ function prep_pull_tag_summary
 	fi
 }
 
+function tag_branch
+{
+	local tag branch
+	tag=$1
+	branch=$2
+
+	tag_summary | $DRY git tag -F- $tag "$branch@{upstream}"
+	$DRY git tag -a $DIM_GPG_KEYID -f $tag
+}
+
 # dim_pull_request branch upstream
 function dim_pull_request
 {
@@ -1669,8 +1679,7 @@ function dim_pull_request
 			tag="$branch-$dim_today-$((++suffix))"
 		done
 		gitk "$branch@{upstream}" ^$upstream &
-		prep_pull_tag_summary | $DRY git tag -F- $tag "$branch@{upstream}"
-		$DRY git tag -a $DIM_GPG_KEYID -f $tag
+		tag_branch $tag $branch
 		$DRY git push $remote $tag
 		prep_pull_mail $req_file $tag
 
-- 
2.15.0



More information about the dim-tools mailing list