[PATCH 1/3] dim: Move special handling of drm-intel-next's repo to branch_to_repo

Rodrigo Vivi rodrigo.vivi at intel.com
Fri Aug 24 21:43:34 UTC 2018


I don't understand exactly why we need this special handling only
for drm-intel-next. But let's at least consolidate this into
branch_to_repo instead of spreading it around.

Cc: Jani Nikula <jani.nikula at intel.com>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
---
 dim | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/dim b/dim
index 5040d6b046b2..fec51f766e55 100755
--- a/dim
+++ b/dim
@@ -290,6 +290,10 @@ function branch_to_repo # branch
 		fi
 	done
 
+	if [[ "$1" == "drm-intel-next" ]] ; then
+		echo "drm-intel"
+	fi
+
 	echo ""
 }
 
@@ -1402,10 +1406,6 @@ function dim_checkout
 	if ! git_branch_exists $branch ; then
 		repo=$(branch_to_repo $branch)
 
-		if [[ $branch == "drm-intel-next" ]] ; then
-			repo="drm-intel"
-		fi
-
 		if [[ $repo == "" ]] ; then
 			echoerr "$branch not found in $dim_integration_config"
 			exit 1
@@ -1890,6 +1890,7 @@ function dim_pull_request
 	branch=${1:?$usage}
 	upstream=${2:?$usage}
 	remote=$(branch_to_remote $branch)
+	repo=$(branch_to_repo $branch)
 	req_file=$(mktemp)
 
 	if [ "$branch" != "drm-intel-next" ]; then
@@ -1906,16 +1907,12 @@ function dim_pull_request
 		drm_intel_next_tags=$(git log "$branch@{upstream}" ^$upstream --decorate | grep "(.*tag: drm-intel-next-" | sed -e "s/^.*(.*tag: \(drm-intel-next-[^ ,]*\).*)$/\1/")
 		prep_pull_mail $req_file $drm_intel_next_tags
 		tag=$(git describe --all --exact "$branch@{upstream}")
-
-		repo="drm-intel"
 	else
 		tag=$(tag_name "$branch")
 		gitk --first-parent "$branch" ^$upstream &
 		tag_branch $tag $branch
 		$DRY git push $remote $tag
 		prep_pull_mail $req_file $tag
-
-		repo=$(branch_to_repo $branch)
 	fi
 
 	url_list=${drm_tip_repos[$repo]}
-- 
2.17.1



More information about the dim-tools mailing list