[PATCH v2] dim: simplify maintainer-tools setup

Daniele Ceraolo Spurio daniele.ceraolospurio at intel.com
Mon Jan 7 21:39:33 UTC 2019



On 01/04/2019 02:31 AM, Jani Nikula wrote:
> 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.
> 

Makes sense now that the repo structure is simplified. Do you think it 
is still worth going through with this change in the meantime to fix dim 
setup while we wait for your rework or should I just drop it?

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

I thought about this as well, but decided against including it to keep 
the patch simple and avoid having to add logic to update existing setups 
using the maintainer-tools branch.

Daniele

> 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
> 


More information about the dim-tools mailing list