[PATCH 2/5] dim: auto-commit in apply-pull if rerere solved it all

Jani Nikula jani.nikula at linux.intel.com
Fri May 4 14:10:27 UTC 2018


On Fri, 04 May 2018, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> Now that we experiment with dim for drm-next it's much more likely
> that pull requests have conflicts. But also that dim already knows
> about them, in the recent drm-intel-next pull it resolve 7/8
> conflicts.

I'll bet rerere will be really appealing for Dave. But until now we've
been able to shrug off potential bogus conflict resolutions with the
thought that it's just for drm-tip and not for real. Now it'll be for
real. *gasp*.

One nit below.

>
> If it solves them all then just go ahead an commit.
>
> Cc: Dave Airlie <airlied at gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  dim | 20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
>
> diff --git a/dim b/dim
> index d2eb4a0cb6e2..97b4f8d1531b 100755
> --- a/dim
> +++ b/dim
> @@ -505,9 +505,7 @@ function check_conflicts # tree
>  		# we need an empty line to make it look pretty
>  		echoerr ""
>  		echoerr "FAILURE: Could not merge $1"
> -		echoerr "See the section \"Resolving Conflicts when Rebuilding drm-tip\""
> -		echoerr "in the drm-intel.rst documentation for how to handle this situation."
> -		exit 1
> +		return 1
>  	fi
>  	true
>  }
> @@ -703,7 +701,11 @@ function dim_rebuild_tip
>  				echo -n "Applying manual fixup patch for $integration_branch merge... "
>  				patch -p1 -i $fixup_file
>  			fi
> -			check_conflicts "$repo/$branch"
> +			if ! check_conflicts "$repo/$branch" ; then
> +				echoerr "See the section \"Resolving Conflicts when Rebuilding drm-tip\""
> +				echoerr "in the drm-intel.rst documentation for how to handle this situation."

Please make that drm-tip.rst while pushing.

Reviewed-by: Jani Nikula <jani.nikula at intel.com>


> +				return 1
> +			fi
>  			git add -u
>  
>  			# because we filter out fast-forward merges there will
> @@ -925,7 +927,15 @@ function dim_apply_pull
>  	git fetch $pull_branch
>  	checkpatch_commit_push_range "HEAD..FETCH_HEAD"
>  
> -	$DRY git pull $pull_branch
> +	if ! $DRY git pull $pull_branch ; then
> +		if ! check_conflicts "$pull_branch" ; then
> +			echoerr "Please resolve and then commit normally using git"
> +			return 1
> +		else
> +			git add -u
> +			git commit --no-edit --quiet
> +		fi
> +	fi
>  
>  	message_id=$(message_get_id $file)

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the dim-tools mailing list