History log of /gem5/util/git-pre-commit.py
Revision Date Author Comments
# 13540:da30e62884ee 10-Jan-2019 Andrea Mondelli <andrea.mondelli@ucf.edu>

misc: updated shabang for python script

The default python on MacOS doesn’t have an alias to python2.
The official python version supported in gem5 is Python2.7.

This patch updates the shabang according to the version required in gem5.

Change-Id: I9533c0f7858b5b3cab0ef101be1ee5cd718105b0
Reviewed-on: https://gem5-review.googlesource.com/c/15375
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 11828:36b064696175 10-Feb-2017 Jason Lowe-Power <jason@lowepower.com>

misc: Update #!env calls for python to explicit version

In some newer Linux distributions, env python default to Python 3.0. This
patch explicitly uses "python2" instead of just "python" for all scripts
that use #!

Reported-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>


# 11716:95a34c2188f2 25-Nov-2016 Rekai Gonzalez Alberquilla <rekai.gonzalezalberquilla@arm.com>

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]


# 11509:d7e83588e5bc 02-Jun-2016 Gabor Dozsa <gabor.dozsa@arm.com>

style: respect per verifier ignores for git commit

Change-Id: Id00379bdb17594e627ee49c077fb75f499ea550e
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 11467:e2ac1018d3aa 28-Apr-2016 Curtis Dunham <Curtis.Dunham@arm.com>

style: respect ignores for git commit

Previously it ignored the ignores for git but not Mercurial.

Change-Id: I178fe879ebd268e863063eb9e30ec87e8ac8faec
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>


# 11465:256ddcabe5e6 28-Apr-2016 Andreas Sandberg <andreas.sandberg@arm.com>

style: Don't include diff context in git style hook

The git style hook currently includes a few lines of diff context when
determining changed regions. This is undesirable as this triggers
false positives when modifying existing files with a lot of style
violations. This change sets the amount of context to 0, which is the
default value when requesting staged regions from the git helper.

Change-Id: Ibe03123e329ea0241281e104183a68d6c495b190
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nathanael Premillieu <nathanael.premillieu@arm.com>


# 11407:e6cc41b0a03c 30-Mar-2016 Andreas Sandberg <andreas.sandberg@arm.com>

style: Add a git pre-commit hook

Add a git pre-commit hook that verifies that files that are about to
be committed. Since git stages changes into an index and the index
contains the changes that will be committed, the style checker only
looks at the state of files in the index.

Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Reviewed-by: Steve Reinhardt <steve.reinhardt@amd.com>