-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .git-blame-ignore-revs #1532
Conversation
.git-blame-ignore-revs
Outdated
# DRIVERS-2789 | ||
ca372f0c6a1353742437d65131b37544492692c2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend using git log -n 1 --format=format:"%H # %s (%cs)" <hash>
to generate entries for this file. e.g.:
ca372f0c6a1353742437d65131b37544492692c2 # Sync with 4b7d7573 (2024-02-26)
634d6399bc166d27f290599d8facf034fa17be91 # Sync with 4b7d7573 (2024-02-26)
405e736abf6884c69669fcc060ef76c44f2e63e7 # Sync with 4b7d7573 (2024-02-26)
...
cea087babea68571fa4068ace6b2d326c3a0a22d # DRIVERS-2789 Convert BSON Corpus Spec to Markdown (#1499) (2024-01-23)
e9ae09da918dc7ca7e5ae12a1af6ca34e9c7854e # DRIVERS-2790 Add codespell checker (#1491) (2024-01-10)
eef59d9d386bb054e0eb59e6bd540a030186f899 # DRIVERS-2789 Use Markdown for Specifications Documentation (#1482) (2024-01-04)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used cat .git-blame-ignore-revs | xargs -n1 git log -n 1 --format=format:"%H # %s (%cs)" $1
to update.
I'd like to defer my explicit approval/disapproval until more feedback is given by other reviewers. However, I lean towards disapproval (rejecting proposed changes in this PR). To reiterate my comments from external discussion in short summary, I would rather deal with the presence of the Markdown conversion and the "Sync with" commits in the line-based git blame history over allowing for the possibility of misleading git blame line-to-commit attribution resulting from the use of Examples of the concerning line-based git blame behavior with ignored refs include (note: use of
I recommend other reviewers examine the quality of line-based git blame history of affected files when considering the proposed changes in this PR. |
@@ -0,0 +1,39 @@ | |||
# DRIVERS-2789 | |||
ca372f0c6a1353742437d65131b37544492692c2 # Sync with 4b7d7573 (2024-02-26) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub's syntax highlighter/linter seems to dislike trailing comments (highlighting lines red), but I believe it should be fine. Per fsck.skipList documentation (the format used by --ignore-revs-file):
On versions of Git 2.20 and later, comments (#), empty lines, and any leading and trailing whitespace are ignored. Everything but a SHA-1 per line will error out on older versions.
And per v2.20 source code:
Allow trailing comments, leading whitespace (including before commits), and empty or whitespace only lines.
If this is undesirable and we want to make GitHub's syntax highlighter/linter happy, we can use git log -n 1 --format=format:"# %s (%cs)%n%H%n%n"
instead:
# Sync with 4b7d7573 (2024-02-26)
ca372f0c6a1353742437d65131b37544492692c2
# Sync with 4b7d7573 (2024-02-26)
634d6399bc166d27f290599d8facf034fa17be91
# Sync with 4b7d7573 (2024-02-26)
405e736abf6884c69669fcc060ef76c44f2e63e7
...
However, I recommend sticking with the current format that uses trailing comments.
I agree with @eramongodb's assessment. |
Alright, I'll close this PR. (The file can at least be applied locally.) |
See:
This ignores some reformatting commits arising from DRIVERS-2789 when viewing git blame on GitHub and in other tools. Tested
auth.md
in IntelliJ.Blame before, note most lines attributed to the
Sync with 4b7d757
commit.Blame after (as of this change). In some cases, tools do not identify the correct commit.