Script to perform pre-commit patch checking

In order to make patch maintenance less error prone, and to help keeping
the overall health of the development branch, a check patch script was
created. It's location is utils/check_patch.py. It will:

 * Apply the patch, with the convenience of fetching the patch directly
 * from patchwork if you give a patchwork patch id.
 * If there are new files created, remember user to add them to VCS.
 * If any added file looks like a executable file, remember user to make
 * them executable.
 * If any of the files added or modified introduces trailing
 * whitespaces, tabs or incorrect indentation, report problems.
 * If any of the files have problems during pylint validation, report
 * failures.
 * If any of the files changed have a unittest suite, run the unittest
 * suite and report any failures.

{{{
Usage: check_patch.py -p [/path/to/patch]
       check_patch.py -i [patchwork id]
}}}

Reindenting changes, reverting files, adding files to VCS, changing
executable bits can be performed by the script if you agree with it.
Unittest failures and static check errors are more involved, and a
failure report might not mean problems necessarily. The idea is to avoid
common mistakes and help keeping the repo as clean as possible.

The script was developed in order to be VCS independent, but as we
still use SVN, only the SVN backend was implemented. Other backends
can be easily implemented as we see fit. I would highly recommend
to apply to vcs using this own script, as it will help to add itself
to version control and mark it as executable.

How to set it up and examples can be find under:

http://autotest.kernel.org/wiki/UsingCheckPatch

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3787 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed