[dim PATCH 3/3] dim: Add generic tag-branch command

Sean Paul seanpaul at chromium.org
Fri Feb 2 20:08:11 UTC 2018

In addition to tag-next, which is specific to drm-intel-next, add a
generic tag-branch which tags any branch.

Signed-off-by: Sean Paul <seanpaul at chromium.org>
 dim     | 26 ++++++++++++++++----------
 dim.rst | 16 +++++++++++-----
 2 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/dim b/dim
index cb7bba08afbf..19ba2a0d46f2 100755
--- a/dim
+++ b/dim
@@ -1718,26 +1718,32 @@ function dim_update_next_continue
 	     -i $req_file "${test_request_recipients[@]}"
-function dim_tag_next
+function dim_tag_branch
-	local intel_remote tag
+	local branch remote tag
+	branch=$1
+	remote=$(branch_to_remote $branch)
-	intel_remote=$(repo_to_remote drm-intel)
-	git fetch $intel_remote
+	git fetch $remote
-	if [ $(git rev-parse drm-intel-next) == $(git rev-parse "drm-intel-next@{u}") ] ; then
-		echo "Tagging current drm-intel-next"
+	if [ $(git rev-parse $branch) == $(git rev-parse "$branch@{u}") ] ; then
+		echo "Tagging current $branch"
-		tag=$(tag_name "drm-intel-next")
-		tag_branch $tag drm-intel-next
-		git push $DRY_RUN $intel_remote $tag
+		tag=$(tag_name "$branch")
+		tag_branch $tag $branch
+		git push $DRY_RUN $remote $tag
-		echo "drm-intel-next not up-to-date, aborting"
+		echo "$branch not up-to-date, aborting"
+function dim_tag_next
+	dim_tag_branch "drm-intel-next"
 # dim_pull_request branch upstream
diff --git a/dim.rst b/dim.rst
index 6f64d5cad364..2712a539ed6a 100644
--- a/dim.rst
+++ b/dim.rst
@@ -408,15 +408,21 @@ When **update-next** fails to push the special release commit (because it raced
 another committer) rebase and push manually, and then continue using this
+tag-branch *branch*
-Pushes a new tag for the current drm-intel-next state after checking that the
-remote is up-to-date. Useful if drm-intel-next has been changed since the last
-run of the update-next command (e.g. to apply a hotfix before sending out the
-pull request).
+Pushes a new tag for the specified branch after checking that the remote is 
 The tag will be signed using the key specified by \$DIM_GPG_KEYID, if set.
+**tag-branch** shorthand for drm-intel-next.
+Useful if drm-intel-next has been changed since the last run of the
+update-next command (e.g. to apply a hotfix before sending out the pull request).

More information about the dim-tools mailing list