[PATCH] dim: allow tags in backmerges
Daniel Vetter
daniel.vetter at ffwll.ch
Tue Aug 7 13:04:41 UTC 2018
On Mon, Aug 6, 2018 at 10:16 PM, Dave Airlie <airlied at gmail.com> wrote:
> On 7 August 2018 at 06:11, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
>> Linus prefers that we backmerge a specific tag instead of a random
>> point in his branch. Allow that.
>>
>> I guess it'd be nice to somehow figure out where a tag came from, but
>> git doesn't namespace tags. So that idea is out of the window
>> unfortunately.
>>
>> v2: Unlazy and also update the docs.
>>
>> v3: Make the check work from anywhere, we need to move the cd a bit
>> up (Dave).
>
> Tested-by: Dave Airlie <airlied at redhat.com>
> Reviewed-by: Dave Airlie <airlied at redhat.com>
And pushed. Thanks for report/test/review.
-Daniel
>
>>
>> Requested-by: Dave Airlie <airlied at redhat.com>
>> Cc: Dave Airlie <airlied at redhat.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
>> ---
>> dim | 7 +++++--
>> dim.rst | 3 ++-
>> 2 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/dim b/dim
>> index e477d043458b..5ca4646ff685 100755
>> --- a/dim
>> +++ b/dim
>> @@ -1010,11 +1010,14 @@ function dim_backmerge
>> branch=${1:?$usage}
>> upstream=${2:?$usage}
>>
>> + cd $DIM_PREFIX/drm-tip
>> +
>> if ! dim_list_upstreams | grep -q "^$upstream\$"; then
>> - warn_or_fail "$upstream is not an upstream branch"
>> + if ! git rev-parse --verify -q "refs/tags/$upstream" > /dev/null ; then
>> + warn_or_fail "$upstream is neither an upstream branch nor a tag"
>> + fi
>> fi
>>
>> - cd $DIM_PREFIX/drm-tip
>> tip_remote=$(repo_to_remote drm-tip)
>> git fetch -q $tip_remote || true
>>
>> diff --git a/dim.rst b/dim.rst
>> index a99e40678a2f..ed784fe20913 100644
>> --- a/dim.rst
>> +++ b/dim.rst
>> @@ -335,7 +335,8 @@ backmerge *branch* *upstream*
>>
>> Backmerges *upstream* into *branch*, making a few sanity checks on the way. The
>> *upstream* we backmerge should be the same as used for sending out pull requests
>> -using **pull-request**.
>> +using **pull-request**. Alternatively it can also be a tag, which if available
>> +should be preferred.
>>
>> update-next
>> -----------
>> --
>> 2.18.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
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the dim-tools
mailing list