[dim PATCH 3/7] dim: return early on tag-branch fail

Daniel Vetter daniel at ffwll.ch
Thu Dec 6 08:37:11 UTC 2018


On Wed, Dec 05, 2018 at 05:02:55PM +0200, Jani Nikula wrote:
> Reduce indent on the happy day scenario. Update error logging while at
> it.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>

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

> ---
>  dim | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/dim b/dim
> index 8e782eecff70..b227f0db99dc 100755
> --- a/dim
> +++ b/dim
> @@ -1892,16 +1892,16 @@ function dim_tag_branch
>  
>  	git fetch $remote
>  
> -	if [ $(git rev-parse $branch) == $(git rev-parse "$branch@{u}") ] ; then
> -		echo "Tagging current $branch"
> -
> -		tag=$(tag_name "$branch")
> -		tag_branch $tag $branch
> -		git push $DRY_RUN $remote $tag
> -	else
> -		echo "$branch not up-to-date, aborting"
> -		exit
> +	if [ $(git rev-parse $branch) != $(git rev-parse "$branch@{u}") ]; then
> +		echoerr "ERROR: $branch not up-to-date"
> +		return 1
>  	fi
> +
> +	echo "Tagging current $branch"
> +
> +	tag=$(tag_name "$branch")
> +	tag_branch $tag $branch
> +	git push $DRY_RUN $remote $tag
>  }
>  
>  function dim_tag_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