diff options
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 |
