Skip to content

Instantly share code, notes, and snippets.

@shubhank-saxena
Last active November 4, 2020 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubhank-saxena/af6ae3793a15cf208d29b730a81f2112 to your computer and use it in GitHub Desktop.
Save shubhank-saxena/af6ae3793a15cf208d29b730a81f2112 to your computer and use it in GitHub Desktop.
This extracts all the error from output of checkpatch.pl
#!/bin/bash
git log v5.7..v5.8 --format=format:"%H" --no-merges &> ./hashes.txt
input="./hashes.txt"
while IFS= read -r line
do
err=$(./scripts/checkpatch.pl --git "$line" --mailback --terse --show-types)
type=$(echo $err| cut -d':' -f 3,4)
echo "$type" >> errors.txt
done < "$input"
rm ./hashes.txt
#This is for most frequent error
cat errors.txt | sort | uniq -c | sort -n | tail -n1
#To list all the occuring errors
cat errors.txt | sort | uniq -c | sort
rm ./errors.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment