Add option to use pre-upload.py as a pre-submit hook
The new command line option (--pre-submit) forces the script to run
the check on the files prepared to be submitted as opposed to running
on the previously submitted patches.
This, among other things, requires filtering out several checks (those
applying to the commit message contents).
The 'commit' function argument throughout this script means 'the sha1
of a commit'. A special value ('pre-submit') is used to indicate that
the git command should operate not on a commit but on a cached change
prepared to be committed.
Checks involving checpatch.pl need to be amended to include the
--ignore=MISSING_SIGN_OFF command line option, as the commit message
is not available in this case.
. verified that ./pre-upload_unittest.py still passes
. created bogus CLs in ~/trucnk/src/platform/depthcharge and
~/trunk/src/third_party/kernel/3.4 and observed proper error
messages generated when running
$ <path to>/pre-upload.py --pre-submit
in those trees.
Signed-off-by: Vadim Bendebury <email@example.com>
1 file changed