Add a presubmit hook for platform2

src/platform2 contains a lot of projects which creates a lot of noise in git
log. Namespacing the git commits will make it easier to match a git commit to a
given project.

The repo hook will:
* Do nothing for commits spanning multiple top level directories.
* For changes contained in a single top level directory, enforce a commit
* message starting with "project_name: " where project name is:
  - the content of .project_alias if it exists
  or
  - the top level directory name.

BUG=chromium:391131
TEST=Create a commit that modify only libchromeos. The commit is accepted if and
only if the commit message start with libchromeos:.
TEST=Create a commit that modify only libchromeos. Create a file .project_alias
containing lchromeos. The commit is accepted if and only if the commit message
startswith lchromeos:.

Change-Id: I77a9302bdc689fd32df0a872a9f8f7e3d08e01b5
Reviewed-on: https://chromium-review.googlesource.com/206879
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
1 file changed