From 80f3b5706857f419d533523fb32501a6a90a7f4e Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Wed, 25 Sep 2024 16:17:30 +0000 Subject: [PATCH] Reuse GIT_BLAME_IGNORE_REV_FILE variable R=gavinmak@google.com Bug: 368562244 Change-Id: I06ed5e92a65459a13d51aeed26ad0a29392ff30e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5891532 Auto-Submit: Josip Sokcevic Reviewed-by: Gavin Mak Commit-Queue: Josip Sokcevic --- .git-blame-ignore-revs | 26 ++++++++++++++++++++++++++ git_hyper_blame.py | 7 +++---- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000..b9a90b39b --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,26 @@ +# git hyper-blame master ignore list. +# +# This file contains a list of git hashes of revisions to be ignored by git +# hyper-blame (in depot_tools). These revisions are considered "unimportant" in +# that they are unlikely to be what you are interested in when blaming. +# +# Instructions: +# - Only large (generally automated) reformatting or renaming CLs should be +# added to this list. Do not put things here just because you feel they are +# trivial or unimportant. If in doubt, do not put it on this list. +# - Precede each revision with a comment containing the first line of its log. +# For bulk work over many commits, place all commits in a block with a single +# comment at the top describing the work done in those commits. +# - Only put full 40-character hashes on this list (not short hashes or any +# other revision reference). +# - Append to the bottom of the file (revisions should be in chronological order +# from oldest to newest). +# - Because you must use a hash, you need to append to this list in a follow-up +# CL to the actual reformatting CL that you are trying to ignore. + +# switch to 4 space indent +691128f836966a645a53185c98e8f83a9b1bcf0c +f38dc929a88633e54d1911ba94b2b37a6c164238 +677616322a2bc16ed43ac0b3729eed23b50757f4 +124bb8e53ca9508b59c0ed6321c1ea43f8321296 +edba22d4eb12b5db5bdee7dc921da7857be1b687 diff --git a/git_hyper_blame.py b/git_hyper_blame.py index 9c2d1a737..8907fcde7 100755 --- a/git_hyper_blame.py +++ b/git_hyper_blame.py @@ -19,8 +19,6 @@ import setup_color logging.getLogger().setLevel(logging.INFO) -DEFAULT_IGNORE_FILE_NAME = '.git-blame-ignore-revs' - class Commit(object): """Info about a commit.""" @@ -382,8 +380,9 @@ def main(args, outbuf): filename = os.path.normcase(filename) ignored_list = list(args.ignored) - if not args.no_default_ignores and os.path.exists(DEFAULT_IGNORE_FILE_NAME): - with open(DEFAULT_IGNORE_FILE_NAME) as ignore_file: + if not args.no_default_ignores and \ + os.path.exists(git_common.GIT_BLAME_IGNORE_REV_FILE): + with open(git_common.GIT_BLAME_IGNORE_REV_FILE) as ignore_file: ignored_list.extend(parse_ignore_file(ignore_file)) if args.ignore_file: