Parcourir la source

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 <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Josip Sokcevic il y a 11 mois
Parent
commit
80f3b57068
2 fichiers modifiés avec 29 ajouts et 4 suppressions
  1. 26 0
      .git-blame-ignore-revs
  2. 3 4
      git_hyper_blame.py

+ 26 - 0
.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

+ 3 - 4
git_hyper_blame.py

@@ -19,8 +19,6 @@ import setup_color
 
 
 logging.getLogger().setLevel(logging.INFO)
 logging.getLogger().setLevel(logging.INFO)
 
 
-DEFAULT_IGNORE_FILE_NAME = '.git-blame-ignore-revs'
-
 
 
 class Commit(object):
 class Commit(object):
     """Info about a commit."""
     """Info about a commit."""
@@ -382,8 +380,9 @@ def main(args, outbuf):
     filename = os.path.normcase(filename)
     filename = os.path.normcase(filename)
 
 
     ignored_list = list(args.ignored)
     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))
             ignored_list.extend(parse_ignore_file(ignore_file))
 
 
     if args.ignore_file:
     if args.ignore_file: