[PATCH v2] dim: simplify maintainer-tools setup

Jani Nikula jani.nikula at linux.intel.com
Fri Jan 4 10:31:09 UTC 2019


On Thu, 03 Jan 2019, Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com> wrote:
> When using worktree, the src repo might already have a master
> branch, which would make dim setup fail. Since maintainer-tools
> is now a simple stand-alone repo, we can just do a simple git clone
> instead of using the worktree. Also, rename the branch in the repo
> to maintainer-tools since that is what other parts of dim expect.
>
> v2: use simple git clone instead of using worktree and specifying
>     the branch name (Daniel), update commit title and message
>     accordingly.

Thanks for the patch. I've been thinking of doing something like this
myself, but haven't gotten around to it yet.

My idea was to turn this around a bit, though. For fresh installs, make
it the starting point to do:

$ cd $DIM_PREFIX
$ git clone https://gitlab.freedesktop.org/drm/maintainer-tools.git

i.e. drop all the maintainer-tools installation stuff from dim. It's a
chicken and egg anyway, and with maintainer-tools now in its own repo,
it's most straighforward to just have the users git clone it. Have dim
install and update the rest.

I'd also like to switch to using the master branch in maintainer-tools
repo. So instead of catering for an old quirk, make dim more sensible.

BR,
Jani.

>
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
> ---
>  dim | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/dim b/dim
> index 9b20154d0c92..e97a2b14defd 100755
> --- a/dim
> +++ b/dim
> @@ -2067,6 +2067,20 @@ function dim_status
>  	done
>  }
>  
> +function setup_maintainer_tools_checkout
> +{
> +	local dir branch
> +
> +	dir=$DIM_PREFIX/maintainer-tools
> +	branch=maintainer-tools
> +
> +	if [ ! -d $dir ]; then
> +		echo "Setting up maintainer-tools ..."
> +		git clone $maintainer_tools_https $dir
> +		git --git-dir=$dir/.git branch -m $branch
> +	fi
> +}
> +
>  function setup_aux_checkout # name url directory
>  {
>  	local name url dir remote
> @@ -2131,7 +2145,7 @@ function dim_setup
>  
>  	cd $DIM_PREFIX
>  
> -	setup_aux_checkout master $maintainer_tools_https maintainer-tools
> +	setup_maintainer_tools_checkout
>  
>  	setup_aux_checkout rerere-cache $drm_tip_ssh drm-rerere

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the dim-tools mailing list