Skip to contentSkip to conversation

dim: Enforce review requirements

PATCH In review Daniel Vetter 5 participants 7 messages May 24, 2017 – May 30, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dim: Enforce review requirements

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Also update the docs to highlight that review requirements hold especially also for bugfixes.

Cc Patrik Jakobsson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Sean Paul <[email protected]>
---
 dim          | 42 ++++++++++++++++++++++++++++++++++++++----
 drm-misc.rst |  4 +++-
 2 files changed, 41 insertions(+), 5 deletions(-)
dim +38 -4
index baa0b3832314..79738a1b37a0 100755
@@ -340,6 +340,15 @@ function git_branch_exists # branch
 	fi
 }
 
+function git_committer_email
+{
+	if ! commiter_email=$(git config --get user.email) ; then
+		commiter_email=$EMAIL
+	fi
+
+	echo $commiter_email
+}
+
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -632,11 +641,32 @@ function dim_rebuild_tip
 		exit 1
 	fi
 }
+
+# additional patch checks before pushing, e.g. for r-b tags
+function checkpatch_commit_push
+{
+	local sha1
+
+	sha1=$1
+
+	# check for a-b/r-b tag
+	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
+		return
+	fi
+
+	# check for commiter != author
+	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then
+		return
+	fi
+
+	warn_or_fail "$sha1 is lacking mandatory review"
+}
+
 # push branch $1, rebuild drm-tip. the rest of the arguments are passed to git
 # push.
 function dim_push_branch
 {
-	local branch remote
+	local branch remote commiter_email
 
 	branch=${1:?$usage}
 	shift
@@ -645,6 +675,12 @@ function dim_push_branch
 
 	remote=$(branch_to_remote $branch)
 
+	commiter_email=$(git_committer_email)
+
+	for sha1 in $(git rev-list $branch@{u}..$branch --committer="$commiter_email" --no-merges) ; do
+		checkpatch_commit_push $sha1
+	done
+
 	git push $DRY_RUN $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes
@@ -690,9 +726,7 @@ function dim_apply_branch
 
 	message_id=$(message_get_id $file)
 
-	if ! commiter_email=$(git config --get user.email) ; then
-		commiter_email=$EMAIL
-	fi
+	commiter_email=$(git_committer_email)
 
 	patch_from=$(grep "From:" "$file" | head -1)
 	if [[ "$patch_from" != *"$commiter_email"* ]] ; then
drm-misc.rst +3 -1
index caba8dc77696..d56c3c7f92a3 100644
@@ -90,7 +90,9 @@ Merge Criteria
 Right now the only hard merge criteria are:
 
 * Patch is properly reviewed or at least Ack, i.e. don't just push your own
-  stuff directly.
+  stuff directly. This rule holds even more for bugfix patches - it would be
+  embarrassing if the bugfix contains a small gotcha that review would have
+  caught.
 
 * drm-misc is for drm core (non-driver) patches, subsystem-wide refactorings,
   and small trivial patches all over (including drivers). For a detailed list of
Signature · 6 lines
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Daniel Vetter

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Also update the docs to highlight that review requirements hold especially also for bugfixes.

Quoted 6 lines
Cc Patrik Jakobsson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Sean Paul <[email protected]>

Thanks,

Lukas

Quoted 101 lines
---
 dim          | 42 ++++++++++++++++++++++++++++++++++++++----
 drm-misc.rst |  4 +++-
 2 files changed, 41 insertions(+), 5 deletions(-)
dim +38 -4
index baa0b3832314..79738a1b37a0 100755
@@ -340,6 +340,15 @@ function git_branch_exists # branch
 	fi
 }
 
+function git_committer_email
+{
+	if ! commiter_email=$(git config --get user.email) ; then
+		commiter_email=$EMAIL
+	fi
+
+	echo $commiter_email
+}
+
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -632,11 +641,32 @@ function dim_rebuild_tip
 		exit 1
 	fi
 }
+
+# additional patch checks before pushing, e.g. for r-b tags
+function checkpatch_commit_push
+{
+	local sha1
+
+	sha1=$1
+
+	# check for a-b/r-b tag
+	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
+		return
+	fi
+
+	# check for commiter != author
+	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then
+		return
+	fi
+
+	warn_or_fail "$sha1 is lacking mandatory review"
+}
+
 # push branch $1, rebuild drm-tip. the rest of the arguments are passed to git
 # push.
 function dim_push_branch
 {
-	local branch remote
+	local branch remote commiter_email
 
 	branch=${1:?$usage}
 	shift
@@ -645,6 +675,12 @@ function dim_push_branch
 
 	remote=$(branch_to_remote $branch)
 
+	commiter_email=$(git_committer_email)
+
+	for sha1 in $(git rev-list $branch@{u}..$branch --committer="$commiter_email" --no-merges) ; do
+		checkpatch_commit_push $sha1
+	done
+
 	git push $DRY_RUN $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes
@@ -690,9 +726,7 @@ function dim_apply_branch
 
 	message_id=$(message_get_id $file)
 
-	if ! commiter_email=$(git config --get user.email) ; then
-		commiter_email=$EMAIL
-	fi
+	commiter_email=$(git_committer_email)
 
 	patch_from=$(grep "From:" "$file" | head -1)
 	if [[ "$patch_from" != *"$commiter_email"* ]] ; then
drm-misc.rst +3 -1
index caba8dc77696..d56c3c7f92a3 100644
@@ -90,7 +90,9 @@ Merge Criteria
 Right now the only hard merge criteria are:
 
 * Patch is properly reviewed or at least Ack, i.e. don't just push your own
-  stuff directly.
+  stuff directly. This rule holds even more for bugfix patches - it would be
+  embarrassing if the bugfix contains a small gotcha that review would have
+  caught.
 
 * drm-misc is for drm core (non-driver) patches, subsystem-wide refactorings,
   and small trivial patches all over (including drivers). For a detailed list of
Signature · 1 line
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter
Quoted 15 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]]
Sent: Wednesday, May 24, 2017 5:28 AM
To: DRI Development
Cc: Intel Graphics Development; Daniel Vetter; Patrik Jakobsson; Lukas Wunner; Deucher, Alexander; Christian König; Sean Paul; Daniel Vetter
Subject: [PATCH] dim: Enforce review requirements

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Also update the docs to highlight that review requirements hold especially also for bugfixes.

Quoted 6 lines
Cc Patrik Jakobsson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Sean Paul <[email protected]>
Quoted 102 lines
---
 dim          | 42 ++++++++++++++++++++++++++++++++++++++----
 drm-misc.rst |  4 +++-
 2 files changed, 41 insertions(+), 5 deletions(-)
dim +24 -0
index baa0b3832314..79738a1b37a0 100755
@@ -340,6 +340,15 @@ function git_branch_exists # branch
 	fi
 }
 
+function git_committer_email
+{
+	if ! commiter_email=$(git config --get user.email) ; then
+		commiter_email=$EMAIL
+	fi
+
+	echo $commiter_email
+}
+
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -632,11 +641,32 @@ function dim_rebuild_tip
 		exit 1
 	fi
 }
+
+# additional patch checks before pushing, e.g. for r-b tags
+function checkpatch_commit_push
+{
+	local sha1
+
+	sha1=$1
+
+	# check for a-b/r-b tag
+	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
+		return
+	fi
+
+	# check for commiter != author
+	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s

$sha1 --format="format:%ae") ]]; then

dim +6 -0
+		return
+	fi
+
+	warn_or_fail "$sha1 is lacking mandatory review"
+}
+
 # push branch $1, rebuild drm-tip. the rest of the arguments are passed to

git

 # push.
 function dim_push_branch
 {
dim +4 -1
-	local branch remote
+	local branch remote commiter_email
 
 	branch=${1:?$usage}
 	shift
@@ -645,6 +675,12 @@ function dim_push_branch
 
 	remote=$(branch_to_remote $branch)
 
+	commiter_email=$(git_committer_email)
+
+	for sha1 in $(git rev-list $branch@{u}..$branch --

committer="$commiter_email" --no-merges) ; do

dim +3 -0
+		checkpatch_commit_push $sha1
+	done
+
 	git push $DRY_RUN $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next-queued drm-intel-next-

fixes drm-intel-fixes

dim +1 -3
@@ -690,9 +726,7 @@ function dim_apply_branch
 
 	message_id=$(message_get_id $file)
 
-	if ! commiter_email=$(git config --get user.email) ; then
-		commiter_email=$EMAIL
-	fi
+	commiter_email=$(git_committer_email)
 
 	patch_from=$(grep "From:" "$file" | head -1)
 	if [[ "$patch_from" != *"$commiter_email"* ]] ; then
drm-misc.rst +3 -1
index caba8dc77696..d56c3c7f92a3 100644
@@ -90,7 +90,9 @@ Merge Criteria
 Right now the only hard merge criteria are:
 
 * Patch is properly reviewed or at least Ack, i.e. don't just push your own
-  stuff directly.
+  stuff directly. This rule holds even more for bugfix patches - it would be
+  embarrassing if the bugfix contains a small gotcha that review would have
+  caught.
 
 * drm-misc is for drm core (non-driver) patches, subsystem-wide
 refactorings,
Quoted 3 lines

and small trivial patches all over (including drivers). For a detailed list of
--
2.11.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Daniel Vetter
Quoted 3 lines · Daniel Vetter

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

BTW, can we also have a rule that large drivers (i.e. with a large user base) are required to provide at least one person at all times (or at least outside the merge window) who is able to review fixes, push them to the driver's repo and send a timely pull to Dave?

On multiple occasions I've seen Dave send a fixes pull with an apology along the lines of "a bit more than usual at this time of the cycle because it includes two weeks worth of driver XYZ fixes".

Thanks,

Lukas
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 5 lines · Lukas Wunner
Quoted 3 lines · Daniel Vetter

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Quoted 8 lines

BTW, can we also have a rule that large drivers (i.e. with a large user base) are required to provide at least one person at all times (or at least outside the merge window) who is able to review fixes, push them to the driver's repo and send a timely pull to Dave?

On multiple occasions I've seen Dave send a fixes pull with an apology along the lines of "a bit more than usual at this time of the cycle because it includes two weeks worth of driver XYZ fixes".

AMD is already planning to swtich to a group/committer model, I just discussed that with Alex. That takes care of the huge drivers (intel/amd) and the small ones (if they are in drm-misc). No idea what we'll end up doing with the medium sized drivers, but I guess that's a discussion for the next months/years ...
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 1/1
#5 lore raw
In reply to Daniel Vetter
Quoted 4 lines · Daniel Vetter

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Quoted 8 lines

Also update the docs to highlight that review requirements hold especially also for bugfixes.

Cc Patrik Jakobsson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Sean Paul <[email protected]>

I think I acked this on IRC, but just in case,

Quoted 101 lines
---
 dim          | 42 ++++++++++++++++++++++++++++++++++++++----
 drm-misc.rst |  4 +++-
 2 files changed, 41 insertions(+), 5 deletions(-)
dim +38 -4
index baa0b3832314..79738a1b37a0 100755
@@ -340,6 +340,15 @@ function git_branch_exists # branch
 	fi
 }
 
+function git_committer_email
+{
+	if ! commiter_email=$(git config --get user.email) ; then
+		commiter_email=$EMAIL
+	fi
+
+	echo $commiter_email
+}
+
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -632,11 +641,32 @@ function dim_rebuild_tip
 		exit 1
 	fi
 }
+
+# additional patch checks before pushing, e.g. for r-b tags
+function checkpatch_commit_push
+{
+	local sha1
+
+	sha1=$1
+
+	# check for a-b/r-b tag
+	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
+		return
+	fi
+
+	# check for commiter != author
+	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then
+		return
+	fi
+
+	warn_or_fail "$sha1 is lacking mandatory review"
+}
+
 # push branch $1, rebuild drm-tip. the rest of the arguments are passed to git
 # push.
 function dim_push_branch
 {
-	local branch remote
+	local branch remote commiter_email
 
 	branch=${1:?$usage}
 	shift
@@ -645,6 +675,12 @@ function dim_push_branch
 
 	remote=$(branch_to_remote $branch)
 
+	commiter_email=$(git_committer_email)
+
+	for sha1 in $(git rev-list $branch@{u}..$branch --committer="$commiter_email" --no-merges) ; do
+		checkpatch_commit_push $sha1
+	done
+
 	git push $DRY_RUN $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes
@@ -690,9 +726,7 @@ function dim_apply_branch
 
 	message_id=$(message_get_id $file)
 
-	if ! commiter_email=$(git config --get user.email) ; then
-		commiter_email=$EMAIL
-	fi
+	commiter_email=$(git_committer_email)
 
 	patch_from=$(grep "From:" "$file" | head -1)
 	if [[ "$patch_from" != *"$commiter_email"* ]] ; then
drm-misc.rst +3 -1
index caba8dc77696..d56c3c7f92a3 100644
@@ -90,7 +90,9 @@ Merge Criteria
 Right now the only hard merge criteria are:
 
 * Patch is properly reviewed or at least Ack, i.e. don't just push your own
-  stuff directly.
+  stuff directly. This rule holds even more for bugfix patches - it would be
+  embarrassing if the bugfix contains a small gotcha that review would have
+  caught.
 
 * drm-misc is for drm core (non-driver) patches, subsystem-wide refactorings,
   and small trivial patches all over (including drivers). For a detailed list of
Signature · 1 line
2.11.0
Signature · 5 lines
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#6 lore raw
In reply to Daniel Vetter
Quoted 102 lines · Daniel Vetter

We can't check this when applying (since r-b/a-b tags often get added afterwards), but we can check this when pushing. This only looks at patches authored by the pusher.

Also update the docs to highlight that review requirements hold especially also for bugfixes.

Cc Patrik Jakobsson <[email protected]>
Cc Lukas Wunner <[email protected]>
Cc Alex Deucher <[email protected]>
Cc Christian König <[email protected]>
Cc Sean Paul <[email protected]>
---
 dim          | 42 ++++++++++++++++++++++++++++++++++++++----
 drm-misc.rst |  4 +++-
 2 files changed, 41 insertions(+), 5 deletions(-)
dim +38 -4
index baa0b3832314..79738a1b37a0 100755
@@ -340,6 +340,15 @@ function git_branch_exists # branch
 	fi
 }
 
+function git_committer_email
+{
+	if ! commiter_email=$(git config --get user.email) ; then
+		commiter_email=$EMAIL
+	fi
+
+	echo $commiter_email
+}
+
 # get message id from file
 # $1 = file
 message_get_id ()
@@ -632,11 +641,32 @@ function dim_rebuild_tip
 		exit 1
 	fi
 }
+
+# additional patch checks before pushing, e.g. for r-b tags
+function checkpatch_commit_push
+{
+	local sha1
+
+	sha1=$1
+
+	# check for a-b/r-b tag
+	if git show -s $sha1 | grep -qi '\(reviewed\|acked\)\S*-by:'  ; then
+		return
+	fi
+
+	# check for commiter != author
+	if [[ $(git show -s $sha1 --format="format:%ce") != $(git show -s $sha1 --format="format:%ae") ]]; then
+		return
+	fi
+
+	warn_or_fail "$sha1 is lacking mandatory review"
+}
+
 # push branch $1, rebuild drm-tip. the rest of the arguments are passed to git
 # push.
 function dim_push_branch
 {
-	local branch remote
+	local branch remote commiter_email
 
 	branch=${1:?$usage}
 	shift
@@ -645,6 +675,12 @@ function dim_push_branch
 
 	remote=$(branch_to_remote $branch)
 
+	commiter_email=$(git_committer_email)
+
+	for sha1 in $(git rev-list $branch@{u}..$branch --committer="$commiter_email" --no-merges) ; do
+		checkpatch_commit_push $sha1
+	done
+
 	git push $DRY_RUN $remote $branch "$@"
 
 	update_linux_next $branch drm-intel-next-queued drm-intel-next-fixes drm-intel-fixes
@@ -690,9 +726,7 @@ function dim_apply_branch
 
 	message_id=$(message_get_id $file)
 
-	if ! commiter_email=$(git config --get user.email) ; then
-		commiter_email=$EMAIL
-	fi
+	commiter_email=$(git_committer_email)
 
 	patch_from=$(grep "From:" "$file" | head -1)
 	if [[ "$patch_from" != *"$commiter_email"* ]] ; then
drm-misc.rst +0 -0
index caba8dc77696..d56c3c7f92a3 100644

drm-misc.rst Merge Criteria · line 98

Quoted 10 lines
drm-misc.rst +3 -1
@@ -90,7 +90,9 @@ Merge Criteria
 Right now the only hard merge criteria are:
 
 * Patch is properly reviewed or at least Ack, i.e. don't just push your own
-  stuff directly.
+  stuff directly. This rule holds even more for bugfix patches - it would be
+  embarrassing if the bugfix contains a small gotcha that review would have
+  caught.
 
 * drm-misc is for drm core (non-driver) patches, subsystem-wide refactorings,
   and small trivial patches all over (including drivers). For a detailed list of

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx