diff options
Diffstat (limited to 'v4l/scripts')
-rwxr-xr-x | v4l/scripts/prep_commit_msg.pl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl index cb0740a5d..1316a7c44 100755 --- a/v4l/scripts/prep_commit_msg.pl +++ b/v4l/scripts/prep_commit_msg.pl @@ -49,8 +49,27 @@ if ($user eq "") { $user = "$ENV{USER} <>"; } +$checkpatch=$ENV{CHECKPATCH}; + +if (!$checkpatch) { + $checkpatch="/lib/modules/`uname -r`/build/scripts/checkpatch.pl"; +} + print "# Added/removed/changed files:\n"; system "hg $diff | diffstat -p1 -c"; + +open IN,"hg $diff | $checkpatch -q --nosignoff --notree -|"; +my $err=0; +while (<IN>) { + if (!$err) { + print "#\n# WARN: checkpatch.pl returned some errors. Please fix.\n"; + $err=1; + } + print "# $_"; +} +close IN; + + if (-s $autopatch) { print "#\n# Note, a problem with your patch was detected! These changes were made\n"; print "# automatically: $autopatch\n"; |