[PATCH 2/2] dim: Look up drm-next/fixes remotes

Daniel Vetter daniel.vetter at ffwll.ch
Tue May 22 09:14:47 UTC 2018


... instead of hard-coding them. Will allow us to move the drm
subsystem trees around without also having to update dim.

Inspired by a patch from Jani.

I did test dim status and dim list-upstreams, but not the pull request
related commands (for lack of having pull requests to do, yay for
being a maintainer, no longer).

Cc: Jani Nikula <jani.nikula at intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/dim b/dim
index 118c446b87d5..4a8184ce2f80 100755
--- a/dim
+++ b/dim
@@ -1788,7 +1788,7 @@ function dim_update_next
 	$DRY git add drivers/gpu/drm/i915/i915_drv.h
 	git commit $DRY_RUN -sm "drm/i915: Update DRIVER_DATE to $driver_date"
 
-	gitk --first-parent drm-intel-next-queued ^$(repo_to_remote drm-upstream)/drm-next &
+	gitk --first-parent drm-intel-next-queued ^$(branch_to_remote drm-next) &
 
 	# try to push dinq first in case someone raced
 	FORCE=1 dim_push_queued
@@ -1906,7 +1906,7 @@ function dim_pull_request
 
 function dim_pull_request_next
 {
-	upstream=${1:-$(repo_to_remote drm-upstream)/drm-next}
+	upstream=${1:-$(branch_to_remote drm-next)}
 	dim_pull_request drm-intel-next $upstream
 }
 
@@ -1918,7 +1918,7 @@ function dim_pull_request_fixes
 
 function dim_pull_request_next_fixes
 {
-	upstream=${1:-$(repo_to_remote drm-upstream)/drm-next}
+	upstream=${1:-$(branch_to_remote drm-next)}
 	dim_pull_request drm-intel-next-fixes $upstream
 }
 
@@ -1933,10 +1933,8 @@ function dim_list_upstreams
 	dim_drm_remote=$(repo_to_remote drm)
 
 	echo origin/master
-	echo $dim_drm_upstream_remote/drm-next
-	echo $dim_drm_upstream_remote/drm-fixes
-	echo $dim_drm_remote/drm-next
-	echo $dim_drm_remote/drm-fixes
+	echo $(branch_to_remote drm-next)/drm-next
+	echo $(branch_to_remote drm-fixes)/drm-fixes
 }
 
 # Note: used by bash completion
@@ -1992,6 +1990,7 @@ function dim_update_branches
 function dim_status
 {
 	local repo remote drm_remote patches
+	local drm_next_upstream drm_fixes_upstream
 
 	cd $DIM_PREFIX/$DIM_REPO
 
@@ -2002,8 +2001,11 @@ function dim_status
 	for branch in $dim_branches ; do
 		repo=$(branch_to_repo $branch)
 		remote=$(repo_to_remote $repo)
+		drm_next_upstream=$(branch_to_remote drm-fixes)/drm-fixes
+		drm_fixes_upstream=$(branch_to_remote drm-next)/drm-next
 
-		patches=$(git log --oneline $remote/$branch ^origin/master ^$drm_remote/drm-next ^$drm_remote/drm-fixes | wc -l)
+		patches=$(git log --oneline $remote/$branch ^origin/master \
+			^$drm_next_upstream ^$drm_fixes_upstream | wc -l)
 
 		if [[ $patches -ne 0 ]] ; then
 			echo $repo/$branch: $patches unmerged patches
-- 
2.17.0



More information about the dim-tools mailing list