diff options
| author | Carlos Maiolino <[email protected]> | 2026-05-02 14:09:27 +0200 |
|---|---|---|
| committer | Carlos Maiolino <[email protected]> | 2026-05-02 14:09:27 +0200 |
| commit | 296c6b9ee85209c0ce375717e30686545baea107 (patch) | |
| tree | f0da71650e8f58ca528589ad4e39476732fa5b88 /maintainer_old/checkpatch | |
| parent | b2e1a1cb259e482720430ff9898d2e564ee73d0f (diff) | |
Diffstat (limited to 'maintainer_old/checkpatch')
| -rwxr-xr-x | maintainer_old/checkpatch/checkpatch.py | 8 | ||||
| -rwxr-xr-x | maintainer_old/checkpatch/checkpatch.sh | 52 |
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 |
