[PATCH 2/5] dim: Fix Link: checking regression

Daniel Vetter daniel at ffwll.ch
Wed May 23 12:23:01 UTC 2018


On Wed, May 23, 2018 at 01:35:56PM +0300, Jani Nikula wrote:
> On Wed, 23 May 2018, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> > In
> >
> > commit c0c4dc1c924bd1d94315601026a2f9facd8a7f73
> > Author: Daniel Vetter <daniel.vetter at ffwll.ch>
> > Date:   Wed May 2 15:08:24 2018 +0200
> >
> >     dim: check all commits in dim apply-pull and push-branch
> >
> > I broke the managed_branch logic which made sure we don't check for
> > Link: tags for pulled branches (since external pulls are most likely
> > not managed by dim complaining about the lack of Link: tags is just
> > noise).
> >
> > Fix this.
> >
> > Also fix some missing local variables while at it.
> >
> > Cc: Jani Nikula <jani.nikula at linux.intel.com>
> > Cc: Dave Airlie <airlied at gmail.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> > ---
> >  dim | 14 ++++++++------
> >  1 file changed, 8 insertions(+), 6 deletions(-)
> >
> > diff --git a/dim b/dim
> > index 629fe1cb71be..2fa158231228 100755
> > --- a/dim
> > +++ b/dim
> > @@ -745,10 +745,10 @@ function dim_rebuild_tip
> >  # additional patch checks before pushing, e.g. for r-b tags
> >  function checkpatch_commit_push
> >  {
> > -	local sha1 non_dim rv
> > +	local sha1 managed_branch rv author committer author_outlook
> >  
> >  	sha1=$1
> > -	managed_branch=${2:-1}
> > +	managed_branch=${2}
> 
> Curly braces no longer required, and I guess it's a bit funny that some
> functions have the managed branch as first and some as last argument,
> but *shrug*

Will drop the {} before merging, but for the argument placement I don't
have a good idea: Generally I think flag arguments like this should be
last, but checkpatch_commit_push_range needs the list of git log arguments
last since there can be a variable amount of them. Not ideal, but didn't
have a better idea :-/
-Daniel

> 
> Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> 
> 
> >  	rv=0
> >  
> >  	# use real names for people with many different email addresses
> > @@ -787,12 +787,14 @@ function checkpatch_commit_push
> >  
> >  function checkpatch_commit_push_range
> >  {
> > -	local rv
> > +	local rv managed_branch
> >  
> > +	managed_branch=$1
> > +	shift
> >  	rv=0
> >  
> >  	for sha1 in $(git rev-list "$@" --no-merges) ; do
> > -		checkpatch_commit_push $sha1 || rv=1
> > +		checkpatch_commit_push $sha1 $managed_branch || rv=1
> >  	done
> >  
> >  	if [ $rv == "1" ] ; then
> > @@ -815,7 +817,7 @@ function dim_push_branch
> >  
> >  	committer_email=$(git_committer_email)
> >  
> > -	checkpatch_commit_push_range "$branch@{u}..$branch" --committer="$committer_email"
> > +	checkpatch_commit_push_range 1 "$branch@{u}..$branch" --committer="$committer_email"
> >  
> >  	git push $DRY_RUN $remote $branch "$@"
> >  
> > @@ -943,7 +945,7 @@ function dim_apply_pull
> >  		warn_or_fail "Nothing in the pull request"
> >  	fi
> >  
> > -	checkpatch_commit_push_range "HEAD..FETCH_HEAD"
> > +	checkpatch_commit_push_range 0 "HEAD..FETCH_HEAD"
> >  
> >  	if ! $DRY git pull --no-ff $pull_branch ; then
> >  		if ! check_conflicts "$pull_branch" ; then
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

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


More information about the dim-tools mailing list