[Intel-gfx] [maintainer-tools PATCH 3/4] dim: run checkpatch on committed patches on apply

Daniel Vetter daniel at ffwll.ch
Tue Mar 15 13:22:57 UTC 2016


On Tue, Mar 15, 2016 at 11:20:37AM +0200, Jani Nikula wrote:
> The input messages may have base64 encoding and whatnot, and
> checkpatch.pl can't cope with them. Just let 'git am' handle that. The
> upside is that checkpatch will now catch e.g. duplicate signed-off-bys.
> 
> This is a partial revert of
> 
> commit a913db697bb063d374229e5e806e514fa44985d0
> Author: Daniel Vetter <daniel.vetter at ffwll.ch>
> Date:   Wed Oct 14 18:32:49 2015 +0200
> 
>     dim: Store patch in a temp file in apply-patch
> 
> although we'll still keep the temp file for other purposes, such as
> extracting the message-id.
> 
> While at it, drop the obsolete check for drm_i915_private_t. We'll now
> get a build fail for that.
> 
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
> ---
>  dim | 22 +++++++---------------
>  1 file changed, 7 insertions(+), 15 deletions(-)
> 
> diff --git a/dim b/dim
> index a287c9126047..83cc5161c767 100755
> --- a/dim
> +++ b/dim
> @@ -421,8 +421,6 @@ function dim_apply_branch
>  
>  	local message_id=$(message_get_id $file)
>  
> -	shell_checkpatch "cat $file"
> -
>  	local commiter_email=$(git config --get user.email)
>  	local patch_from=$(grep "From:" "$file" | head -1)
>  	local sob
> @@ -438,6 +436,8 @@ function dim_apply_branch
>  		echo "No message-id found in the patch file."
>  	fi
>  
> +	checkpatch_commit HEAD
> +
>  	eval $DRY $DIM_POST_APPLY_ACTION
>  }
>  
> @@ -686,25 +686,17 @@ function check_repo_clean
>  
>  }
>  
> -# $1 is the shell command to display the patch/commit
> -function shell_checkpatch
> -{
> -	local cmd=$1
> -
> -	$cmd | scripts/checkpatch.pl -q --strict - || true
> -	if $cmd | grep '^\+.*\WBUG' > /dev/null; then
> -		warn_or_fail "New BUG macro added"
> -	fi
> -	$cmd | grep '^\+.*drm_i915_private_t' > /dev/null && echo "WARNING: New drm_i915_private_t added" || true

This here seems now lost.
-Daniel

> -}
> -
>  # $1 is the git sha1 to check
>  function checkpatch_commit
>  {
>  	local commit=$1
>  
>  	git --no-pager log --oneline -1 $commit
> -	shell_checkpatch "git show $commit --pretty=email"
> +	git show $commit --pretty=email | scripts/checkpatch.pl -q --emacs --strict - || true
> +
> +	if git show $commit --pretty=email | grep '^\+.*\WBUG' > /dev/null; then
> +		warn_or_fail "New BUG macro added"
> +	fi
>  }
>  
>  dim_alias_check_patch=checkpatch
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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


More information about the Intel-gfx mailing list