summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2016-04-28 15:17:28 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2016-04-28 15:17:28 +0100
commitf8c6ff1d1bc2b92463ddead537bfb73a92ad68a7 (patch)
tree20dc3374f45453b20ac519dec56a39a2899b23f7 /util
parentb80f568bcf6d709314b8cc453630d721a9ba2d8a (diff)
downloadgem5-f8c6ff1d1bc2b92463ddead537bfb73a92ad68a7.tar.xz
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>
Diffstat (limited to 'util')
-rwxr-xr-xutil/git-pre-commit.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/util/git-pre-commit.py b/util/git-pre-commit.py
index 4a18db01f..33437faf3 100755
--- a/util/git-pre-commit.py
+++ b/util/git-pre-commit.py
@@ -58,7 +58,6 @@ git = GitRepo()
opts = {}
repo_base = git.repo_base()
-context = 8
ui = StdioUI()
os.chdir(repo_base)
@@ -68,7 +67,7 @@ for status, fname in git.status(filter="MA", cached=True):
if args.verbose:
print "Checking %s..." % fname
if status == "M":
- regions = git.staged_regions(fname, context=context)
+ regions = git.staged_regions(fname)
else:
regions = all_regions