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/git-checkpatch | |
| parent | b2e1a1cb259e482720430ff9898d2e564ee73d0f (diff) | |
Diffstat (limited to 'maintainer_old/git-checkpatch')
| -rwxr-xr-x | maintainer_old/git-checkpatch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/maintainer_old/git-checkpatch b/maintainer_old/git-checkpatch new file mode 100755 index 0000000..0a34125 --- /dev/null +++ b/maintainer_old/git-checkpatch @@ -0,0 +1,36 @@ +#!/bin/bash + +ldir=/home/cmaiolino/Source/tools/maintainer +source $ldir/djwong-git + +# Run the checkpatch script on every commit in the list. + +if [ "$#" -gt 1 ] || [ "$1" = "--help" ]; then + echo "Usage: $0 <commit range>" 1>&2 + exit 1 +fi +commit_range="$(commit_range_from_arg "$1")" || exit 1 + +readarray -t commits < <(git rev-list --reverse --no-merges "${commit_range}") +if [ "${#commits[@]}" -eq 0 ]; then + echo 'No commits?' + exit 1 +fi + +debug=1 +test -n "${DBG}" && debug=1 +bad=0 +for commit_id in "${commits[@]}"; do + range="${commit_id}^1..${commit_id}" + oneline="$(git log --oneline "${range}")" + + # Dump commit in full format so we get committer + git log --format=full "${range}" | \ + awk -f "$ldir/checkpatch.awk" \ + -v "commit_id=${commit_id}" \ + -v "debug=${debug}" \ + -v "oneline=${oneline}" + test $? -eq 0 || bad=1 +done + +test "${bad}" -eq 0 |
