util: git pre-commit hook to check staged files
authorRekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Fri, 25 Nov 2016 10:31:21 +0000 (10:31 +0000)
committerRekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>
Fri, 25 Nov 2016 10:31:21 +0000 (10:31 +0000)
commitac29b6c6fc93330f5de2f2fbea4f45265e70a16b
tree914cd176889cacb97696563804580f0887790bcb
parentb0856ab3b17e15ff1a6fb329abe87f3434bfe81a
util: git pre-commit hook to check staged files

This patch updates the git-pre-commit hook to check the files as they
will be after the commit, instead of as they are currently, this way we
prevent the undesired situation:
    - unstylish modification of a file
    - stage said file for commit
    - try to commit and fail due to style
    - fix style, forgetting staging changes
    - try to commit and fail, as although the changes staged are not
      styly, the current content of the file is.

Change-Id: I5cc3f783375d9e4162e310e176103ebbf0a59023
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
[andreas.sandberg@arm.com: Rebased ontop of latest gem5]
util/git-pre-commit.py
util/style/verifiers.py