Just checks that merges aren't done without minimal thought.
Cc: Jani Nikula <[email protected]>
Cc: Dave Airlie <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
---
dim | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/dim b/dim
index 2fa158231228..ff9e572726cb 100755
--- a/dim
+++ b/dim
@@ -785,6 +785,24 @@ function checkpatch_commit_push
return $rv
}
+function checkmerge_commit_push
+{
+ local sha1 managed_branch rv body_text
+
+ sha1=$1
+ managed_branch=${2}
+ rv=0
+
+ body_text="$(git show $sha1 -s --format="format:%b" | grep -v "^$" |
grep -v "^\S*:")"
+
+ if [[ -z "$body_text" ]] ; then
+ echoerr "$sha1 is lacking merge commit justification"
+ rv=1
+ fi
+
+ return $rv
+}
+
function checkpatch_commit_push_range
{
local rv managed_branch
@@ -797,6 +815,10 @@ function checkpatch_commit_push_range
checkpatch_commit_push $sha1 $managed_branch || rv=1
done
+ for sha1 in $(git rev-list "$@" --merges) ; do
+ checkmerge_commit_push $sha1 $managed_branch || rv=1
+ done
+
if [ $rv == "1" ] ; then
warn_or_fail "issues in commits detected"
fi
--
2.17.0
_______________________________________________
dim-tools mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dim-tools