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

Daniel Vetter daniel.vetter at ffwll.ch
Wed May 16 07:36:04 UTC 2018


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 c81459355485..c3229fd72193 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}
 	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 $pull_branch ; then
 		if ! check_conflicts "$pull_branch" ; then
-- 
2.17.0



More information about the dim-tools mailing list