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

Jani Nikula jani.nikula at linux.intel.com
Mon Feb 5 10:57:16 UTC 2018


On Fri, 02 Feb 2018, Sean Paul <seanpaul at chromium.org> wrote:
> 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>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  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
>  =================

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the dim-tools mailing list