On 10/5/18 1:02 PM, Eric Blake wrote:
On 10/5/18 12:49 PM, Cleber Rosa wrote:


We could add a git pre-commit hook grep'ing for "^#!\
*(/usr/bin/env|/bin/(b?a)?sh)" in the 1st line and then checking the
file perms.


Good idea.  Probably better to send that as a different patch, right?

Yes, separate patch. For that matter, "^#!/" is probably a sufficient pattern to catch any file that intends to be run via an interpreter, and therefore wants to be executable, rather than limiting to just env and specific shells.

Also, many maintainers already have scripts/checkpatch.pl as a git pre-commit hook, and putting the check in checkpatch.pl means that patchew would also flag the issue.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Reply via email to