dim: add retip command to rebase branch onto drm-tip
PATCH 1/1 dim: add retip command to rebase branch onto drm-tip
Helper to rebase a branch onto drm-tip.
Signed-off-by Jani Nikula <[email protected]>
--- dim | 23 +++++++++++++++++++++++ dim.rst | 6 ++++++ 2 files changed, 29 insertions(+)
dim +23 -0
@@ -345,6 +345,29 @@ function dim_commit_add_tag done } +# $1: branch [optional] +function git_find_tip +{ + git log $1 -1 --format=%H --grep="^drm-tip: .* integration manifest$" +} + +# $1: branch [optional] +function dim_retip +{ + local branch upstream remote + + branch="$1" + shift + remote=$(url_to_remote $drm_tip_ssh) + upstream=$(git_find_tip "$branch") + + if [[ -z "$upstream" ]]; then + echoerr "$branch is not based on drm-tip" + return 1 + fi + + git rebase --onto $remote/drm-tip $upstream $branch "$@" +} # update for-linux-next and for-linux-next-fixes branches function update_linux_next # branch next next-fixes fixes
dim.rst +6 -0
@@ -362,6 +362,12 @@ uptodate -------- Try to check if you're running an up-to-date version of **dim**. +retip [*branch*] [*git-rebase option* ...] +------------------------------------------ + +Rebase the given local branch, current branch by default, onto drm-tip. Options +after the branch will be passed to **git-rebase**. + help ---- Show this help. Install **rst2man(1)** for best results.
Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 3 lines · Jani Nikula
Helper to rebase a branch onto drm-tip.
Signed-off-by Jani Nikula <[email protected]>
I like. Ack.
-Daniel
Quoted 63 lines
--- dim | 23 +++++++++++++++++++++++ dim.rst | 6 ++++++ 2 files changed, 29 insertions(+)dim +23
-0@@ -345,6 +345,29 @@ function dim_commit_add_tag done } +# $1: branch [optional] +function git_find_tip +{ + git log $1 -1 --format=%H --grep="^drm-tip: .* integration manifest$" +} + +# $1: branch [optional] +function dim_retip +{ + local branch upstream remote + + branch="$1" + shift + remote=$(url_to_remote $drm_tip_ssh) + upstream=$(git_find_tip "$branch") + + if [[ -z "$upstream" ]]; then + echoerr "$branch is not based on drm-tip" + return 1 + fi + + git rebase --onto $remote/drm-tip $upstream $branch "$@" +} # update for-linux-next and for-linux-next-fixes branches function update_linux_next # branch next next-fixes fixesdim.rst +6
-0@@ -362,6 +362,12 @@ uptodate -------- Try to check if you're running an up-to-date version of **dim**. +retip [*branch*] [*git-rebase option* ...] +------------------------------------------ + +Rebase the given local branch, current branch by default, onto drm-tip. Options +after the branch will be passed to **git-rebase**. + help ---- Show this help. Install **rst2man(1)** for best results.Signature · 6 lines
2.1.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx