summaryrefslogtreecommitdiff
path: root/maintainer_old/checkpatch
diff options
context:
space:
mode:
Diffstat (limited to 'maintainer_old/checkpatch')
-rwxr-xr-xmaintainer_old/checkpatch/checkpatch.py8
-rwxr-xr-xmaintainer_old/checkpatch/checkpatch.sh52
2 files changed, 60 insertions, 0 deletions
diff --git a/maintainer_old/checkpatch/checkpatch.py b/maintainer_old/checkpatch/checkpatch.py
new file mode 100755
index 0000000..d169872
--- /dev/null
+++ b/maintainer_old/checkpatch/checkpatch.py
@@ -0,0 +1,8 @@
+#!/usr/bin/python3
+
+from pygit2 import *
+
+repo = Repository("./")
+for commit in repo.walk(repo.head.target):
+ print(commit.committer)
+ input()
diff --git a/maintainer_old/checkpatch/checkpatch.sh b/maintainer_old/checkpatch/checkpatch.sh
new file mode 100755
index 0000000..e0eb6a4
--- /dev/null
+++ b/maintainer_old/checkpatch/checkpatch.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+check_fixes() {
+ local TAG=$(echo $1 | sed -e 's/^[ ]*//' | sed 's/^[F,f]ixes://')
+ local HASH=$(echo $TAG | awk '{print $1}')
+
+ git log -1 --format='%s' $HASH &> /dev/null
+
+ if [ $? -ne 0 ]; then
+ echo "Patch $HASH"
+ echo "$TAG"
+ echo "...does not exist"
+ exit 1
+ fi
+
+ local BROKEN_SUB=$(git log -1 --format='%s' $HASH)
+
+ local SUB=$(echo $TAG | awk 'gsub($1, "")'| \
+ sed -e 's/^[ ]*//' | \
+ sed -e 's/^(//' | \
+ sed -e 's/)$//' |\
+ sed -e 's/^"//' | \
+ sed -e 's/"$//')
+
+
+ if [ "$SUB" != "$BROKEN_SUB" ]; then
+ echo "Broken patch does not match Fixes tag:"
+ echo "PATCH: $HASH"
+ else
+ echo "Strings match"
+ fi
+
+}
+
+check_patch() {
+ local PATCH=$1
+ local COMMIT_MSG=$(git log -1 $PATCH)
+
+ local HAS_FIXES=`echo "$COMMIT_MSG" |grep -i fixes:`
+
+ if [ -n "$HAS_FIXES" ]; then
+ check_fixes "$HAS_FIXES"
+ fi
+}
+
+LAST=$1
+
+PATCHES=$(for i in `git log --oneline --no-merges $LAST.. | awk '{print $1}'`; do echo $i; done)
+
+for i in $PATCHES; do
+ check_patch $i
+done