[dim PATCH 5/7] dim: optionally launch gitk with changelog on dim tag-branch

Daniel Vetter daniel at ffwll.ch
Thu Dec 6 08:50:07 UTC 2018


On Wed, Dec 05, 2018 at 05:02:57PM +0200, Jani Nikula wrote:
> Similar to what pull-request currently does. Try to be clever about not
> including all unmerged changes, just the ones that haven't been tagged
> yet.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  dim     | 15 +++++++++++++--
>  dim.rst |  6 ++++--
>  2 files changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/dim b/dim
> index e0f96f78c858..5081e9ac4a34 100755
> --- a/dim
> +++ b/dim
> @@ -1898,9 +1898,10 @@ function dim_update_next_continue
>  
>  function dim_tag_branch
>  {
> -	local branch remote tag
> +	local branch upstream remote tag unmerged_tags
>  
> -	branch=$1
> +	branch=${1:?$usage}
> +	upstream=$2
>  	assert_branch $branch
>  	remote=$(branch_to_remote $branch)
>  
> @@ -1915,6 +1916,16 @@ function dim_tag_branch
>  
>  	echo "Tagging current $branch"
>  
> +	if [[ -n "$upstream" ]]; then

I think an upstream guesstimator would be neat ... linus' branch for
drm-fixes and drm-next, and drm-fixes for any -fixes branches (excluding
-next-fixes), drm-next for everything else.

This should only get topic branch pulls wrong I think.

Anyway, just an idea, patch looks good to me.

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> +		# If there are unmerged tags, show changes since last
> +		unmerged_tags=$(git_unmerged_tags "$branch" "$upstream")
> +		if [[ -n "$unmerged_tags" ]]; then
> +			upstream="${unmerged_tags%% *}"
> +		fi
> +
> +		gitk --first-parent "$branch" "^$upstream" &
> +	fi
> +
>  	tag=$(tag_name "$branch")
>  	tag_branch $tag $branch
>  	git push $DRY_RUN $remote $tag
> diff --git a/dim.rst b/dim.rst
> index 7aa90e659983..792c99f324fa 100644
> --- a/dim.rst
> +++ b/dim.rst
> @@ -374,13 +374,15 @@ 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*
> --------------------
> +tag-branch *branch* [*upstream*]
> +--------------------------------
>  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.
>  
> +If upstream is provided, launch gitk to show the changes to be tagged.
> +
>  tag-next
>  --------
>  **tag-branch** shorthand for drm-intel-next.
> -- 
> 2.11.0
> 
> _______________________________________________
> dim-tools mailing list
> dim-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dim-tools

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dim-tools mailing list