diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-08-06 22:03:40 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-08-07 15:04:11 +0200 |
commit | bfb74c395d1b6a5fe2f2b99d0b83e1703f0af547 (patch) | |
tree | 6439a1ca6ac28c870f7cf6e36bdce8781cf9d83e | |
parent | 387496d5554abd62e6b85faba94b56f1fe27ff08 (diff) |
dim: allow tags in backmerges
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).
Requested-by: Dave Airlie <airlied@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rwxr-xr-x | dim | 7 | ||||
-rw-r--r-- | dim.rst | 3 |
2 files changed, 7 insertions, 3 deletions
@@ -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 @@ -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 ----------- |