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

Daniel Vetter daniel.vetter at ffwll.ch
Tue May 22 12:06:56 UTC 2018


On Tue, May 22, 2018 at 1:41 PM, Jani Nikula <jani.nikula at intel.com> wrote:
> 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?

Indeed, I broke dim rebuild-tip because rerere-cache isn't a dim
branch. So we need the fallback path using the @{upstream}. Also
audited for the implicit validation, and spotted only one place that
needed an explicit assert_branch. Will test a bit more and resend the
revised version.
-Daniel

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



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dim-tools mailing list