diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2022-07-24 17:27:21 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2022-07-31 13:29:20 -0700 |
commit | f27eeaa2e84de306266dac1332638bc0ae452073 (patch) | |
tree | 16cc15b1d4e960be57e4d706638a7cbb8c219b15 | |
parent | c661ca248b53f8bc2211a5fff2c4065901ed3ae5 (diff) | |
download | spack-f27eeaa2e84de306266dac1332638bc0ae452073.tar.gz spack-f27eeaa2e84de306266dac1332638bc0ae452073.tar.bz2 spack-f27eeaa2e84de306266dac1332638bc0ae452073.tar.xz spack-f27eeaa2e84de306266dac1332638bc0ae452073.zip |
black: add .git-blame-ignore-revs toignore black reformatting in blame
- [x] add `.git-blame-ignore-revs` to ignore black reformatting
- [x] make `spack blame` respect `.git-blame-ignore-revs`
(even if the user hasn't configured git to do so)
-rw-r--r-- | .git-blame-ignore-revs | 3 | ||||
-rw-r--r-- | lib/spack/spack/cmd/blame.py | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..a40816eb34 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,3 @@ +# .git-blame-ignore-revs +# Formatted entire codebase with black +0e7b83453cc0115e19c87b6150b4f91eb3d824f3 diff --git a/lib/spack/spack/cmd/blame.py b/lib/spack/spack/cmd/blame.py index 23ac147580..aeedbe72d4 100644 --- a/lib/spack/spack/cmd/blame.py +++ b/lib/spack/spack/cmd/blame.py @@ -131,11 +131,21 @@ def blame(parser, args): # get git blame for the package with working_dir(spack.paths.prefix): + # ignore the great black reformatting of 2022 + ignore_file = os.path.join(spack.paths.prefix, ".git-blame-ignore-revs") + if args.view == "git": - git("blame", blame_file) + git("blame", "--ignore-revs-file", ignore_file, blame_file) return else: - output = git("blame", "--line-porcelain", blame_file, output=str) + output = git( + "blame", + "--line-porcelain", + "--ignore-revs-file", + ignore_file, + blame_file, + output=str, + ) lines = output.split("\n") # Histogram authors |