feat: add a common file for git-blame ignored revisions

sudoforge created

Change-Id: Ia28c12c211c67fccbfc2f6a6dc2be390d13a29c0

Change summary

.git-blame-ignore-revs | 19 +++++++++++++++++++
flake.nix              |  4 ++++
2 files changed, 23 insertions(+)

Detailed changes

.git-blame-ignore-revs 🔗

@@ -0,0 +1,19 @@
+# git blame ignore list
+#
+# This file contains a list of git hashes of revisions to be ignored by
+# git-blame. 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 commits 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
+#   commit to the actual reformatting commit that you are trying to ignore.

flake.nix 🔗

@@ -32,6 +32,10 @@
           shellHook = ''
             # Use //:.gitmessage as the commit message template
             ${pkgs.git}/bin/git config --local commit.template ".gitmessage"
+
+            # Use a common, shared file as the default for running
+            # git-blame with the `--ignore-revs` flag
+            ${pkgs.git}/bin/git config --local blame.ignoreRevsFile ".git-blame-ignore-revs"
           '';
         };
       }