This was slightly more complicated than I expected, we needed Ubuntu Bionic for a recent spatch, and spatch is so slow that we can only check modified files.
I force-pushed the branch to remove the commit and changes entry for "Travis: Use Ubuntu Bionic, but keep Trusty for chutney". I'm backporting that change in #32260 (moved), all the other changes go in master.
Marking as extra-review for the git hooks commits:
scripts/git: Add check_cocci_parse.sh to the pre-commit hook
scripts/git: Only check modified files in existing git hook checks
scripts/git: Make spaces consistent in pre-push.git-hook
Here's how you can check them:
Coccinelle checks for correct C syntax. Here's how you can test it:
Modify a file to have really bad C syntax
Run a hook or make check-cocci
Files in scripts/coccinelle/exceptions.txt are ignored, they have known bad syntax
Files in src/ext are also ignored
pre-commit hook:
At pre-push time, the pre-commit hook takes a list of changed files from the pre-push hook. So you can call the pre-commit hook manually with a list of files
At pre-commit time, the pre-commit hook creates the changed file list itself. So you can call it with no arguments, and a set of staged (git add) files
Install the hooks, and coccinelle, and try a commit