[dim PATCH v2] dim: Add generic tag-branch command

Sean Paul seanpaul at chromium.org
Fri Feb 2 20:13:21 UTC 2018


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

Changes in v2:
- Fix tag-branch doc underline

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)
 
 	cd $DIM_PREFIX/$DIM_REPO
 
-	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
 	else
-		echo "drm-intel-next not up-to-date, aborting"
+		echo "$branch not up-to-date, aborting"
 		exit
 	fi
+}
 
+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..9779e9fbff6f 100644
--- a/dim.rst
+++ b/dim.rst
@@ -408,14 +408,20 @@ When **update-next** fails to push the special release commit (because it raced
 another committer) rebase and push manually, and then continue using this
 command.
 
+tag-branch *branch*
+-------------------
+Pushes a new tag for the specified branch after checking that the remote is 
+up-to-date.
+
+The tag will be signed using the key specified by \$DIM_GPG_KEYID, if set.
+
 tag-next
 --------
-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).
+**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).
 
-The tag will be signed using the key specified by \$DIM_GPG_KEYID, if set.
 
 DIM HELP COMMANDS
 =================
-- 
2.16.0.rc1.238.g530d649a79-goog



More information about the dim-tools mailing list