All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [dim PATCH 4/6] dim: s/DIM_DRM_INTEL/DIM_REPO/
Date: Tue,  3 Oct 2017 16:38:06 +0300	[thread overview]
Message-ID: <20171003133808.28680-5-jani.nikula@intel.com> (raw)
In-Reply-To: <20171003133808.28680-1-jani.nikula@intel.com>

The maintainer repo hasn't been Intel specific for a while now. Rename
the variable. DIM_DRM_INTEL is used as a default for DIM_REPO for
backward compatibility.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 dim          | 48 ++++++++++++++++++++++++------------------------
 dim.rst      | 10 +++++-----
 dimrc.sample |  6 +++---
 3 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/dim b/dim
index f2cc25fc4ce9..610f65a1a903 100755
--- a/dim
+++ b/dim
@@ -46,9 +46,9 @@ fi
 DIM_PREFIX=${DIM_PREFIX:-$HOME/linux}
 
 # main maintainer repo under $DIM_PREFIX
-DIM_DRM_INTEL=${DIM_DRM_INTEL:-src}
+DIM_REPO=${DIM_REPO:-${DIM_DRM_INTEL:-src}}
 
-# name of the $drm_intel_ssh remote within $DIM_DRM_INTEL
+# name of the $drm_intel_ssh remote within $DIM_REPO
 DIM_DRM_INTEL_REMOTE=${DIM_DRM_INTEL_REMOTE:-drm-intel}
 
 # mail user agent. must support a subset of mutt(1) command line options:
@@ -224,7 +224,7 @@ fi
 export __dim_running=1
 
 if [ "$subcommand" != "setup" ] && [ "$subcommand" != "help" ] && [ "$subcommand" != "usage" ]; then
-	for d in $DIM_PREFIX $DIM_PREFIX/$DIM_DRM_INTEL $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
+	for d in $DIM_PREFIX $DIM_PREFIX/$DIM_REPO $DIM_PREFIX/drm-rerere $DIM_PREFIX/drm-tip; do
 		if [ ! -d $d ]; then
 			echoerr "$d is missing, please check your configuration and/or run dim setup"
 			exit 1
@@ -566,7 +566,7 @@ function rr_cache_dir
 	if [ -d $DIM_PREFIX/drm-tip/.git/ ] ; then
 		echo $DIM_PREFIX/drm-tip/.git/rr-cache
 	else
-		echo $DIM_PREFIX/$DIM_DRM_INTEL/.git/rr-cache
+		echo $DIM_PREFIX/$DIM_REPO/.git/rr-cache
 	fi
 }
 
@@ -1216,7 +1216,7 @@ function dim_create_branch
 	start=${2:-HEAD}
 	repo="drm-intel"
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 
 	repo=${branch%%/*}
 	branch=${branch#*/}
@@ -1243,7 +1243,7 @@ function dim_remove_branch
 
 	branch=${1:?$usage}
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 
 	if [[ -d $DIM_PREFIX/$branch ]] ; then
 		rm -R $DIM_PREFIX/$branch
@@ -1284,7 +1284,7 @@ function dim_cd
 	if [[ -d $DIM_PREFIX/$1 ]] ; then
 		path=$DIM_PREFIX/$1
 	else
-		path=$DIM_PREFIX/$DIM_DRM_INTEL
+		path=$DIM_PREFIX/$DIM_REPO
 	fi
 
 	echo $path > ~/.dim-last-path
@@ -1537,12 +1537,12 @@ function dim_create_workdir
 
 		if git help worktree &> /dev/null; then
 			# native worktree support was added in git 2.5
-			cd $DIM_DRM_INTEL
+			cd $DIM_REPO
 			$DRY git worktree prune
 			$DRY git worktree add $DIM_PREFIX/$branch $branch
 			cd $DIM_PREFIX
 		else
-			$DRY git-new-workdir $DIM_DRM_INTEL $branch $branch
+			$DRY git-new-workdir $DIM_REPO $branch $branch
 		fi
 	done
 }
@@ -1550,7 +1550,7 @@ function dim_create_workdir
 dim_alias_fw=for-each-workdir
 function dim_for_each_workdir
 {
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 	"$@"
 	for branch in $dim_branches ; do
 		if [[ -d $DIM_PREFIX/$branch ]] ; then
@@ -1639,7 +1639,7 @@ function dim_tag_next
 {
 	local tag suffix
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 	git fetch $DIM_DRM_INTEL_REMOTE
 
 	if [ $(git rev-parse drm-intel-next) == $(git rev-parse "drm-intel-next@{u}") ] ; then
@@ -1690,7 +1690,7 @@ function dim_pull_request
 	if [ "$branch" != "drm-intel-next" ]; then
 		assert_branch $branch
 	else
-		cd $DIM_PREFIX/$DIM_DRM_INTEL
+		cd $DIM_PREFIX/$DIM_REPO
 	fi
 
 	git_fetch_helper ${upstream%%/*}
@@ -1767,7 +1767,7 @@ function dim_update_branches
 {
 	local repo remote url_list
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 
 	remote=$(url_to_remote $linux_upstream_git)
 	echo -n "Fetching linux (local remote $remote)... "
@@ -1814,7 +1814,7 @@ function dim_status
 {
 	local repo remote drm_remote patches
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 
 	drm_remote=$(url_to_remote $drm_upstream_git)
 
@@ -1842,7 +1842,7 @@ function setup_aux_checkout # name url directory
 
 	if [ ! -d $dir ]; then
 		if git help worktree &> /dev/null ; then
-			cd $DIM_PREFIX/$DIM_DRM_INTEL
+			cd $DIM_PREFIX/$DIM_REPO
 			remote=$(url_to_remote $url)
 			if ! git_branch_exists $name ; then
 				git_fetch_helper $remote
@@ -1850,10 +1850,10 @@ function setup_aux_checkout # name url directory
 			fi
 			git worktree add $DIM_PREFIX/$dir $name
 		else
-			git clone --reference=$DIM_PREFIX/$DIM_DRM_INTEL/.git $url $dir
+			git clone --reference=$DIM_PREFIX/$DIM_REPO/.git $url $dir
 			cd $dir
 			git config remote.origin.url $url
-			echo "$DIM_PREFIX/$DIM_DRM_INTEL/.git/objects" > .git/objects/info/alternates
+			echo "$DIM_PREFIX/$DIM_REPO/.git/objects" > .git/objects/info/alternates
 			git repack -a -d -l
 			remote=origin
 		fi
@@ -1880,11 +1880,11 @@ function dim_setup
 	fi
 	cd $DIM_PREFIX
 
-	if [ ! -d $DIM_PREFIX/$DIM_DRM_INTEL/.git ]; then
-		echoerr "No git checkout found in $DIM_PREFIX/$DIM_DRM_INTEL."
-		echoerr "Please set up your maintainer linux repository at $DIM_PREFIX/$DIM_DRM_INTEL with"
+	if [ ! -d $DIM_PREFIX/$DIM_REPO/.git ]; then
+		echoerr "No git checkout found in $DIM_PREFIX/$DIM_REPO."
+		echoerr "Please set up your maintainer linux repository at $DIM_PREFIX/$DIM_REPO with"
 		echoerr "    cd $DIM_PREFIX"
-		echoerr "    git clone $linux_upstream_git $DIM_DRM_INTEL"
+		echoerr "    git clone $linux_upstream_git $DIM_REPO"
 		echoerr "or update your configuration (see dimrc.sample)."
 		exit 1
 	fi
@@ -1957,7 +1957,7 @@ function dim_tc
 
 	sha1=${1:?$usage}
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 	tag=$(git tag --contains $sha1 | grep ^v | sort -V | head -n 1)
 	if [[ -n "$tag" ]]; then
 		echo "$tag"
@@ -1985,7 +1985,7 @@ function dim_cite
 
 	sha1=${1:?$usage}
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 
 	git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
 		sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/'
@@ -1997,7 +1997,7 @@ function dim_fixes
 
 	sha1=${1:?$usage}
 
-	cd $DIM_PREFIX/$DIM_DRM_INTEL
+	cd $DIM_PREFIX/$DIM_REPO
 	echo "Fixes: $(dim_cite $sha1)"
 
 	(
diff --git a/dim.rst b/dim.rst
index 41e55a6c9b7c..29d145d40f08 100644
--- a/dim.rst
+++ b/dim.rst
@@ -64,7 +64,7 @@ when adding a remote and, if it's not already done, you should add a new entry i
     $ printf '\nHost git.freedesktop.org\n\tUser <username>' >> ~/.ssh/config
 
 You should now have a main repository for patch application. The directory
-corresponding to this repository is defined by DIM_DRM_INTEL in your .dimrc.
+corresponding to this repository is defined by DIM_REPO in your .dimrc.
 You should also have directories called maintainer-tools, drm-tip (for
 rebuilding the tree), and drm-rerere for some dim-internal book-keeping.
 
@@ -316,7 +316,7 @@ branches if "all" is given.
 for-each-workdir *command*
 --------------------------
 Run the given command in all active workdirs including the main repository under
-\$DIM_DRM_INTEL.
+\$DIM_REPO.
 
 COMMANDS FOR MAINTAINERS
 ========================
@@ -473,13 +473,13 @@ DIM_PREFIX
 ----------
 Path prefix for kernel repositories.
 
-DIM_DRM_INTEL
--------------
+DIM_REPO
+--------
 The main maintainer repository under \$DIM_PREFIX.
 
 DIM_DRM_INTEL_REMOTE
 --------------------
-Name of the $drm_intel_ssh remote within \$DIM_DRM_INTEL.
+Name of the $drm_intel_ssh remote within \$DIM_REPO.
 
 DIM_MUA
 -------
diff --git a/dimrc.sample b/dimrc.sample
index be7b99cb6b76..9f6b786af52f 100644
--- a/dimrc.sample
+++ b/dimrc.sample
@@ -4,14 +4,14 @@
 # Defaults are in the comments below.
 
 # Prefix for the repo directories. The prefix will contain
-# $DIM_DRM_INTEL, drm-tip, maintainer-tools, etc.
+# $DIM_REPO, drm-tip, maintainer-tools, etc.
 #DIM_PREFIX=$HOME/linux
 
 # Name of the main maintainer repo under $DIM_PREFIX.
-#DIM_DRM_INTEL=src
+#DIM_REPO=src
 
 # Name of the remote for ssh://git.freedesktop.org/git/drm-intel within
-# $DIM_DRM_INTEL
+# $DIM_REPO
 #DIM_DRM_INTEL_REMOTE=danvet
 
 # Mail User Agent supporting a subset of mutt(1) command line options:
-- 
2.11.0

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

  parent reply	other threads:[~2017-10-03 13:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 13:38 dim: some repo/remote refactoring Jani Nikula
2017-10-03 13:38 ` [dim PATCH 1/6] dim: require explicit repo in create-branch Jani Nikula
2017-10-03 13:38 ` [dim PATCH 2/6] dim: url_to_remote can't normally fail Jani Nikula
2017-10-03 15:17   ` Jani Nikula
2017-10-05  8:57     ` Jani Nikula
2017-10-05 17:05   ` Daniel Vetter
2017-10-06  8:54     ` Jani Nikula
2017-10-03 13:38 ` [dim PATCH 3/6] dim: look at all tip branches in dim tc Jani Nikula
2017-10-03 13:38 ` Jani Nikula [this message]
2017-10-03 13:38 ` [dim PATCH 5/6] dim: figure drm-intel remote out automatically Jani Nikula
2017-10-03 13:38 ` [dim PATCH 6/6] dim: reduce dependency on hard-coded repo URLs Jani Nikula
2017-10-05 17:08   ` Daniel Vetter
2017-10-05  8:53 ` [dim PATCH] dim: cd to dim repo in list-upstreams Jani Nikula
2017-10-05 17:09   ` 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=20171003133808.28680-5-jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --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.