[PATCH] dim: basic checks for pull requests too
Daniel Vetter
daniel.vetter at ffwll.ch
Fri Dec 8 09:29:57 UTC 2017
dim push doesn't check everyone's patches (since most subsystems don't
have strict review requirements). But when we take a pull request we
really want to make sure people follow due process.
Motivated by the recent gvt pull, which lacked a commiter sob.
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
dim | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/dim b/dim
index 4c7baae99c9a..10026e9e1a14 100755
--- a/dim
+++ b/dim
@@ -693,9 +693,12 @@ function dim_rebuild_tip
# additional patch checks before pushing, e.g. for r-b tags
function checkpatch_commit_push
{
- local sha1
+ local sha1 non_dim
sha1=$1
+ managed_branch=${2:-1}
+
+ echo checking $sha1, managed $managed_branch
# use real names for people with many different email addresses
author=$(git show -s $sha1 --format="format:%an")
@@ -714,7 +717,7 @@ function checkpatch_commit_push
fi
# check for Link tag
- if ! git show -s $sha1 | grep -qi 'Link:' ; then
+ if [[ "$managed_branch" = "1" ]] && ! git show -s $sha1 | grep -qi 'Link:' ; then
warn_or_fail "$sha1 is lacking of link tag"
fi
@@ -861,7 +864,12 @@ function dim_apply_pull
echo $pull_branch
- git pull $pull_branch
+ git fetch $pull_branch
+ for sha1 in $(git rev-list "HEAD..FETCH_HEAD" --no-merges) ; do
+ checkpatch_commit_push $sha1 0
+ done
+
+ $DRY git pull $pull_branch
message_id=$(message_get_id $file)
--
2.15.0
More information about the dim-tools
mailing list