Skip to contentSkip to conversation

dim: add retip command to rebase branch onto drm-tip

PATCH In review Jani Nikula 2 participants 2 messages Mar 15, 2017 – Mar 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dim: add retip command to rebase branch onto drm-tip

Helper to rebase a branch onto drm-tip.

---
 dim     | 23 +++++++++++++++++++++++
 dim.rst |  6 ++++++
 2 files changed, 29 insertions(+)
dim +23 -0
index a68cc28fd4b2..f1ca50f0d811 100755
@@ -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
index f624b79948ac..a778701c7335 100644
@@ -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
#1 lore raw
Quoted 3 lines · Jani Nikula

Helper to rebase a branch onto drm-tip.

I like. Ack.
-Daniel

Quoted 63 lines
---
 dim     | 23 +++++++++++++++++++++++
 dim.rst |  6 ++++++
 2 files changed, 29 insertions(+)
dim +23 -0
index a68cc28fd4b2..f1ca50f0d811 100755
@@ -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
index f624b79948ac..a778701c7335 100644
@@ -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