[maintainer-tools PATCH RFC 3/3] dim: fix rr_cache_dir discovery

Daniel Vetter daniel at ffwll.ch
Fri Dec 14 16:29:19 UTC 2018


On Fri, Dec 14, 2018 at 02:38:52PM +0100, Andrzej Hajda wrote:
> rr_cache_dir function cannot assume REPO/.git is a directory. On the other
> side it should be backward compatible - if rr-cache directory/link already
> exists it should be returned.
> 
> Signed-off-by: Andrzej Hajda <a.hajda at samsung.com>
> ---
> Hi,
> 
> I am not sure of the purpose of rr-cache symbolic link, dim does not use
> it (except its creation/removal). So this patch should be verified by
> someone who knows better what is going on here.
> 
> Regards
> Andrzej
> ---
>  dim | 20 +++++++++++---------
>  1 file changed, 11 insertions(+), 9 deletions(-)
> 
> diff --git a/dim b/dim
> index 3afa8b6..b72ebfd 100755
> --- a/dim
> +++ b/dim
> @@ -554,15 +554,6 @@ function check_conflicts # tree
>  	true
>  }
>  
> -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_REPO/.git/rr-cache
> -	fi
> -}

I think this breaks it, rr-cache is shared among all worktrees (which is a
big reason for having them).

And yes dim only sets up the symlink, dim rebuild-tip uses the rr-cache
stuff automatically through git merge.
-Daniel

> -
>  function git_dir
>  {
>  	local dir=${1:-$PWD}
> @@ -574,6 +565,17 @@ function git_dir
>  	fi
>  }
>  
> +function rr_cache_dir
> +{
> +	local dir=$(git_dir $DIM_PREFIX/$DIM_REPO)/rr-cache
> +
> +	if [ -d $dir ]; then
> +		echo $dir
> +	else
> +		echo $(git_dir $DIM_PREFIX/drm-tip)/rr-cache
> +	fi
> +}
> +
>  function pull_rerere_cache
>  {
>  	cd $DIM_PREFIX/drm-rerere/
> -- 
> 2.17.1
> 
> _______________________________________________
> dim-tools mailing list
> dim-tools at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dim-tools

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list