From e3d2deccb5c48e104b1334e2f46c75f12e08117e Mon Sep 17 00:00:00 2001 From: William Chargin Date: Mon, 30 Mar 2020 22:08:56 -0700 Subject: [PATCH] blame: ignore reformattings due to Prettier 2.0.1 (#1718) Summary: This commit introduces an `ignoreRevsFile` for use with Git blame. See the header of the new file for details. Test Plan: Run `git blame -L183,183 config/test.js`. Before this change, note that it blames to the reformatting commit. After this change, and after configuring `git config blame.ignoreRevsFile .git-blame-ignore-revs`, note that it blames to the last real change. wchargin-branch: prettier-2.0.1-unblame --- .git-blame-ignore-revs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..428f530 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,20 @@ +# List of commits that `git blame` should ignore. +# +# Include ONLY commits that are known to be no-ops, like automated +# reformattings. +# +# To properly format an entry, run +# +# git show --no-patch --format='%H # %s' COMMIT_HASH +# +# replacing `COMMIT_HASH` with the appropriate hash, or pass similar +# formatting to `git log`, etc. +# +# To use this file, ensure that you have Git 2.23 or later installed, +# then configure your repository to teach it about this file: +# +# git config blame.ignoreRevsFile .git-blame-ignore-revs +# +# See `git help blame` or `git help config` for details. + +421aded196eb40c1dd3ec103bedc48d13111fa98 # prettier: reformat code for 2.0.1