diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 000000000000..dff4770af5b4 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1 @@ +2eee56616d50a9e26756f855ef4aa0135920ad78 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a185a385b0f..14068a3e8c59 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -422,3 +422,28 @@ the following steps: The `stable/*` branches should only receive changes in the form of bug fixes. + +## Dealing with the git blame ignore list + +In the qiskit-terra repository we maintain a list of commits for git blame +to ignore. This is mostly commits that are code style changes that don't +change the functionality but just change the code formatting (for example, +when we migrated to use black for code formatting). This file, +`.git-blame-ignore-revs` just contains a list of commit SHA1s you can tell git +to ignore when using the `git blame` command. This can be done one time +with something like + +``` +git blame --ignore-revs-file .git-blame-ignore-revs qiskit/version.py + +``` + +from the root of the repository. If you'd like to enable this by default you +can update your local repository's configuration with: + +``` +git config blame.ignoreRevsFile .git-blame-ignore-revs +``` + +which will update your local repositories configuration to use the ignore list +by default.