[PATCH 2/3] dim: Unify tag handling

Daniel Vetter daniel.vetter at ffwll.ch
Wed Dec 13 13:12:32 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 cf272dccd14c..7ab4442a2d3c 100755
--- a/dim
+++ b/dim
@@ -1575,7 +1575,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"
@@ -1615,7 +1615,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"
@@ -1624,7 +1624,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
@@ -1642,6 +1642,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
 {
@@ -1675,8 +1685,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.1



More information about the dim-tools mailing list