[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-dim-tools
Subject:    [PATCH] dim: Move to more readable fixup patch naming scheme
From:       daniel () ffwll ! ch (Daniel Vetter)
Date:       2017-12-07 11:48:38
Message-ID: 20171207114838.2cwecplauvfwz66v () phenom ! ffwll ! local
[Download RAW message or body]

On Thu, Dec 07, 2017 at 01:11:54PM +0200, Joonas Lahtinen wrote:
> Because branch and repo already contain '-', move to use '__' as
> the delimiter between the two for more readability.
> 
> While at it, allow explicitly specifying the branch where the
> fixup should be applied in the case of a non-conflicting merge
> issue.
> 
> Fixing the merge commit of drm-misc-next after noticing drm-tip
> not to build would be done in the following way:
> 
> $ git diff | dim cat-to-fixup drm-misc-next
> 
> Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Please also update dim.rst with the new parameter for cat-to-fixup. Even
better it the conflict resolution howto for drm-tip would get an update,
but I guess that could be a separate patch.

And patching the bash_completion would be neat too.

With that: Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  dim | 37 +++++++++++++++++++++++++++++++++----
>  1 file changed, 33 insertions(+), 4 deletions(-)
> 
> diff --git a/dim b/dim
> index 8b8621d157b2..5c43edd9f8c2 100755
> --- a/dim
> +++ b/dim
> @@ -595,6 +595,23 @@ function fetch_all
>  	done
>  }
>  
> +function find_fixup_file # repo branch
> +{
> +	local file_paths repo branch rerere
> +	repo=$1
> +	branch=$2
> +	rerere=$DIM_PREFIX/drm-rerere
> +
> +	file_paths="$rerere/${repo}-${branch//\//-}-fixup.patch
> +	            $rerere/${repo}__${branch//\//-}-fixup.patch"
> +
> +	for file_path in $file_paths; do
> +		[ -f "$file_path" ] && break
> +	done
> +
> +	echo "$file_path"
> +}
> +
>  function dim_rebuild_tip
>  {
>  	local integration_branch specfile first rerere repo remote
> @@ -652,8 +669,8 @@ function dim_rebuild_tip
>  			echo "Fast-forward. Done."
>  			true
>  		else
> -			fixup_file=$rerere/$repo-${branch//\//-}-fixup.patch
> -			echo $fixup_file > .fixup_file_path
> +			fixup_file=$(find_fixup_file $repo $branch)
> +			echo $branch > .fixup_branch
>  
>  			git merge --rerere-autoupdate --no-commit $sha1 >& /dev/null || true
>  			# normalize conflict markers
> @@ -1909,10 +1926,22 @@ function dim_list_aliases
>  		sed 's/^dim_alias_//;s/=/\t/;s/_/-/g'
>  }
>  
> -function dim_cat_to_fixup
> +function dim_cat_to_fixup # [branch]
>  {
> +	local fixup_file repo branch
> +	branch=$1
> +
>  	cd $DIM_PREFIX/drm-tip
> -	cat > $(cat .fixup_file_path)
> +
> +	if [ -z "$branch" ]; then
> +		branch=$(cat .fixup_branch)
> +	fi
> +
> +	repo=$(branch_to_repo $branch)
> +	fixup_file=$(find_fixup_file $repo $branch)
> +
> +	cat > $fixup_file
> +	echo "Applied fixup for $branch"
>  }
>  
>  function dim_tc
> -- 
> 2.14.3
> 

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic