[PATCH 1/2] dim: Make branch_to_remote more robust

Jani Nikula jani.nikula at intel.com
Tue May 22 11:41:55 UTC 2018


On Tue, 22 May 2018, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> The old version relied on branch@{upstream}, which requires that
> the branch is checked out. Instead use the indirection through the
> abstract drm-tip repo.

ISTR you mentioned the current code also backs as a sanity check in some
cases. At a glance, I think they should fail later on anyway. Is that
right?

BR,
Jani.

>
> Cc: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  dim | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dim b/dim
> index f57dfc2df489..118c446b87d5 100755
> --- a/dim
> +++ b/dim
> @@ -248,11 +248,11 @@ function pick_protocol_url # (git|ssh|https|whatever) url [url ...]
>  
>  function branch_to_remote # branch
>  {
> -	local branch remote
> +	local branch remote repo
>  
>  	branch=$1
> -	remote=$(git rev-parse --abbrev-ref --symbolic-full-name "$branch@{upstream}")
> -	remote=${remote%%/*}
> +	repo=$(branch_to_repo $branch)
> +	remote=$(repo_to_remote $repo)
>  
>  	echo $remote
>  }

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the dim-tools mailing list