All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
To: DRI Development <dri-devel@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: [PATCH 16/18] dim: remove DIM_DRM_UPSTREAM_REMOTE config var
Date: Fri, 21 Oct 2016 21:36:58 +0200	[thread overview]
Message-ID: <20161021193700.22100-17-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20161021193700.22100-1-daniel.vetter@ffwll.ch>

With the automatic remote lookup this is no longer needed. That means
moving get_remote_name a bit, and I'm too lazy to rebase that out.

v2: Wrap strings in "" (Jani).

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 dim          | 56 +++++++++++++++++++++++++++-----------------------------
 dim.rst      |  4 ----
 dimrc.sample |  4 ----
 3 files changed, 27 insertions(+), 37 deletions(-)

diff --git a/dim b/dim
index fc99108b6e55..1ab86d5a4ee9 100755
--- a/dim
+++ b/dim
@@ -50,9 +50,6 @@ DIM_DRM_INTEL=${DIM_DRM_INTEL:-src}
 # name of the $drm_intel_ssh remote within $DIM_DRM_INTEL
 DIM_DRM_INTEL_REMOTE=${DIM_DRM_INTEL_REMOTE:-danvet}
 
-# name of the $drm_upstream_git remote within $DIM_DRM_INTEL
-DIM_DRM_UPSTREAM_REMOTE=${DIM_DRM_UPSTREAM_REMOTE:-airlied}
-
 # mail user agent. must support a subset of mutt(1) command line options:
 # usage: $DIM_MUA [-s subject] [-i file] [-c cc-addr] to-addr [...]
 DIM_MUA=${DIM_MUA:-mutt}
@@ -150,6 +147,24 @@ fi
 # Sanity checks.
 #
 
+function get_remote_name
+{
+	local remote_url=$1
+
+	local remote=`git remote -v | grep $remote_url | \
+		head -n1 | cut -f 1`
+
+	if [[ $remote == "" ]] ; then
+		echoerr "No git remote for $remote_url found in `pwd`."
+		echoerr "Please set it up using"
+		echoerr "    $ git remote add '<name>' $remote_url"
+		echoerr "with a name of your choice."
+		exit 1
+	fi
+
+	echo $remote
+}
+
 if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "usage" ]; then
 	for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
 		if [ ! -d $d ]; then
@@ -165,6 +180,7 @@ if [ "$subcommand" != "setup" -a "$subcommand" != "help" -a "$subcommand" != "us
 	dim_branches=`(source $DIM_PREFIX/drm-rerere/nightly.conf ; echo $nightly_branches) | \
 		xargs -n 1 echo | grep '^\(drm-intel\|drm-misc\)' | \
 		sed -e 's/^\(drm-intel\|drm-misc\)\///'`
+	dim_drm_uptream_remote=`cd $DIM_PREFIX/$DIM_DRM_INTEL; get_remote_name $drm_upstream_git`
 fi
 
 function dim_uptodate
@@ -192,24 +208,6 @@ if [[ "$((`date +%s` % 100))" -eq "0" ]] ; then
         dim_uptodate
 fi
 
-function get_remote_name
-{
-	local remote_url=$1
-
-	local remote=`git remote -v | grep $remote_url | \
-		head -n1 | cut -f 1`
-
-	if [[ $remote == "" ]] ; then
-		echoerr No git remote for $remote_url found in `pwd`.
-		echoerr Please set it up using
-		echoerr     $ git remote add '<name>' $remote_url
-		echoerr with a name of your choice.
-		exit 1
-	fi
-
-	echo $remote
-}
-
 function get_remote_for_branch
 {
 	local remote=`git rev-parse --abbrev-ref --symbolic-full-name $1@{upstream}`
@@ -938,7 +936,7 @@ function dim_update_next
 	echo -e "drm/i915: Update DRIVER_DATE to $driver_date\n\nSigned-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>" | \
 		git commit -s -F -
 
-	gitk drm-intel-next-queued ^$DIM_DRM_UPSTREAM_REMOTE/drm-next &
+	gitk drm-intel-next-queued ^$dim_drm_uptream_remote/drm-next &
 
 	# try to push dinq first in case someone raced
 	dim push-queued
@@ -1051,7 +1049,7 @@ function dim_pull_request
 
 function dim_pull_request_next
 {
-	upstream=${1:-$DIM_DRM_UPSTREAM_REMOTE/drm-next}
+	upstream=${1:-$dim_drm_uptream_remote/drm-next}
 	dim_pull_request drm-intel-next $upstream
 }
 
@@ -1063,7 +1061,7 @@ function dim_pull_request_fixes
 
 function dim_pull_request_next_fixes
 {
-	upstream=${1:-$DIM_DRM_UPSTREAM_REMOTE/drm-next}
+	upstream=${1:-$dim_drm_uptream_remote/drm-next}
 	dim_pull_request drm-intel-next-fixes $upstream
 }
 
@@ -1071,8 +1069,8 @@ function dim_pull_request_next_fixes
 function dim_list_upstreams
 {
 	echo origin/master
-	echo $DIM_DRM_UPSTREAM_REMOTE/drm-next
-	echo $DIM_DRM_UPSTREAM_REMOTE/drm-fixes
+	echo $dim_drm_uptream_remote/drm-next
+	echo $dim_drm_uptream_remote/drm-fixes
 }
 
 # Note: used by bash completion
@@ -1085,7 +1083,7 @@ dim_alias_ub=update-branches
 function dim_update_branches
 {
 	cd $DIM_PREFIX/$DIM_DRM_INTEL
-	for remote in $DIM_DRM_INTEL_REMOTE $DIM_DRM_UPSTREAM_REMOTE origin; do
+	for remote in $DIM_DRM_INTEL_REMOTE $dim_drm_uptream_remote origin; do
 		git fetch $remote
 	done
 
@@ -1237,8 +1235,8 @@ function dim_tc
 		# not in a tagged release, show upstream branches
 		git branch -r --contains $1 \
 		    $DIM_DRM_INTEL_REMOTE/* \
-		    $DIM_DRM_UPSTREAM_REMOTE/drm-next \
-		    $DIM_DRM_UPSTREAM_REMOTE/drm-fixes \
+		    $dim_drm_uptream_remote/drm-next \
+		    $dim_drm_uptream_remote/drm-fixes \
 		    origin/master | sed 's/^ *//'
 	fi
 }
diff --git a/dim.rst b/dim.rst
index ca9670ebc1b5..171c71bfdb6d 100644
--- a/dim.rst
+++ b/dim.rst
@@ -359,10 +359,6 @@ DIM_DRM_INTEL_REMOTE
 --------------------
 Name of the $drm_intel_ssh remote within \$DIM_DRM_INTEL.
 
-DIM_DRM_UPSTREAM_REMOTE
------------------------
-Name of the $drm_upstream_git remote within \$DIM_DRM_INTEL.
-
 DIM_MUA
 -------
 Mail user agent. Must support the following subset of **mutt(1)** command line
diff --git a/dimrc.sample b/dimrc.sample
index 42612a3a9fdf..be7b99cb6b76 100644
--- a/dimrc.sample
+++ b/dimrc.sample
@@ -14,10 +14,6 @@
 # $DIM_DRM_INTEL
 #DIM_DRM_INTEL_REMOTE=danvet
 
-# Name of the remote for git://people.freedesktop.org/~airlied/linux
-# within $DIM_DRM_INTEL
-#DIM_DRM_UPSTREAM_REMOTE=airlied
-
 # Mail User Agent supporting a subset of mutt(1) command line options:
 # [-s subject] [-i file] [-c cc-addr] to-addr [...]
 #DIM_MUA=mutt
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-10-21 19:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 19:36 [PATCH 00/18] dim: split out drm-misc/tip.git Daniel Vetter
2016-10-21 19:36 ` [PATCH 01/18] dim: Extract TODO Daniel Vetter
2016-10-21 19:36 ` [PATCH 02/18] dim: Autocheck for up-to-dateness Daniel Vetter
2016-10-21 19:36 ` [PATCH 03/18] dim: echoerr helper for printing to stderr Daniel Vetter
2016-10-21 19:36 ` [PATCH 04/18] dim: autodetect remotes, first part for dim_setup Daniel Vetter
2016-10-21 19:36 ` [PATCH 05/18] dim: support git worktree for aux checkouts Daniel Vetter
2016-10-21 19:36 ` [PATCH 06/18] dim: Nuke nightly-forget Daniel Vetter
2016-10-21 19:36 ` [PATCH 07/18] dim: autodetect branches in rebuild-nightly Daniel Vetter
2016-10-21 19:36 ` [PATCH 08/18] dim: remove integration-tree remotes Daniel Vetter
2016-10-21 19:36 ` [PATCH 09/18] dim: Split out drm-nightly.git Daniel Vetter
2016-10-21 19:36 ` [PATCH 10/18] dim: s/drm-nightly/drm-tip Daniel Vetter
2016-10-21 19:36 ` [PATCH 11/18] dim: use git branch --list Daniel Vetter
2016-10-21 19:36 ` [PATCH 12/18] dim: add revert-rerere Daniel Vetter
2016-10-21 19:36 ` [PATCH 13/18] dim: use get_maintainers.pl in dim fixes Daniel Vetter
2016-10-21 19:36 ` [PATCH 14/18] dim-update-next: Update DRIVER_TIMESTAMP Daniel Vetter
2016-10-21 19:36 ` [PATCH 15/18] dim: support multiple remotes for branches Daniel Vetter
2016-10-21 19:36 ` Daniel Vetter [this message]
2016-10-21 19:36 ` [PATCH 17/18] dim: Adapat create/remove-branch Daniel Vetter
2016-10-21 19:37 ` [PATCH 18/18] dim: Make update_linux_next multi-repo compliant Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161021193700.22100-17-daniel.vetter@ffwll.ch \
    --to=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.