Skip to content

chore: Ignore ruff-format apply in git blame#862

Merged
MaxymVlasov merged 2 commits intomasterfrom
init_git_blame_ignore
Mar 26, 2025
Merged

chore: Ignore ruff-format apply in git blame#862
MaxymVlasov merged 2 commits intomasterfrom
init_git_blame_ignore

Conversation

@MaxymVlasov
Copy link
Copy Markdown
Collaborator

Follow-up to #861

Copilot AI review requested due to automatic review settings March 26, 2025 14:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • .git-blame-ignore-revs: Language not supported

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 26, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Enhanced contributor guidelines with instructions for configuring version control to ignore insignificant formatting revisions.
  • Chores
    • Introduced a mechanism to exclude non-critical revisions from blame tracking, streamlining code review and maintenance.

Summary by CodeRabbit

  • Chores
    • Enhanced our version control tooling by introducing a mechanism that filters out non-essential commit changes from historical attribution, reducing noise for internal code tracking.

Walkthrough

A new file, .git-blame-ignore-revs, has been added. This file contains a list of Git commit hashes that are to be ignored by the git blame command. It includes instructions and guidelines for using the file with the --ignore-revs-file option or configuring blame.ignoreRevsFile within Git. The file also specifies the format for adding individual and bulk revisions and provides a sample commit hash as an example. Additionally, a new section in .github/CONTRIBUTING.md offers guidance on configuring git blame to ignore formatting commits.

Changes

File(s) Change Summary
.git-blame-ignore-revs Added new file to list Git commit hashes to be ignored by git blame, with detailed usage instructions.
.github/CONTRIBUTING.md Added section on configuring git blame to ignore formatting commits, referencing the new ignore file.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 23928fb and bb56c13.

📒 Files selected for processing (2)
  • .git-blame-ignore-revs (1 hunks)
  • .github/CONTRIBUTING.md (2 hunks)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to add a mention on configuring blame.ignoreRevsFile in Git to the contributing doc. But this is fine to go in otherwise.

Comment thread .git-blame-ignore-revs
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yermulnik wdyt about disabling Copilot till 2026? I can't remember any useful finding from its side

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you. In the other project it helped me to rectify several oversights and mistakes. So I'm fine with it adding its reviews as they don't hurt I guess.

Comment thread .git-blame-ignore-revs
# ignore. This approach helps avoid issues with arbitrary rebases
# and squashes while the pull request is in progress.

23928fbf8511697c915c3231977ee254bd3fa0c2 # chore(linters): Apply ruff-format
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add link to corresponding PR as they recommend it in the comment above?
I mean have both: a textual comment and link to PR 🤔

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave link in merge commit msg, so it will be simple to check PR too

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I compiled those guidelines above from several sources and polished them a bit. I think it's enough to just visually show a commit message + maybe justification. Everything's in Git. Viewing PRs requires internet access. So it's something on top. But they are findable via GH from the commit page, so adding a link on top is probably unnecessary.

Copy link
Copy Markdown
Collaborator

@yermulnik yermulnik Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was to reduce friction: open file, copy link, see what is hidden from git blame VS open file, copy commit id, run git show commit_id, copy PR id, go to GH, switch to PRs tab, find PR or similar =)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not my choice to disallow proper natural merge commits 🤷‍♂️

Copy link
Copy Markdown
Collaborator

@yermulnik yermulnik Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe it was me.

Maybe? 😕
image

Though, I don't think that there's value in links in every single case. OTOH, this is just a boilerplate. It's up to you to decide in each case if you want to add a link. Personally, I think that inline context might be more useful.

What I'm hinting at is that (apart from improved usability where I can just copy URL, if I need to, from the same file I'm looking at instead of digging the same from the git logs) the discrepancy between suggested file format and the format of the entries is odd and adds confusion. Why the heck we need all that huge block with guidelines if we don't give a heck to follow them. Empty that and then we follow «It's up to you to decide in each case» rule. Else it's just a good example of bad manner and the principle of neglecting standards that we create for ourselves.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fair.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤝

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I'm hinting at is that (apart from improved usability where I can just copy URL, if I need to, from the same file I'm looking at instead of digging the same from the git logs)

Well, it not includes much digging if your dev env setup use basics of git blame
Screencast from 27.03.25 15:07:56.webm

It also works out of the box in GitHub itself
Screencast from 27.03.25 15:10:41.webm

And yes, you don't need to copy URL, you can just click on it (in git too, it should be clickable via ctrl+click)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jesus, mate, you do think that VSCode is the sole file viewer in the world (do you indeed mean one must always use VSCode or similar and can't use e.g. less to view files?) or that one must click around to just get — ONCE AGAIN — what is recommended by the whole almost 70(sic!) lines preamble in that file? 🤦🏻
Descriptions are for humans, not for machines! Period.

@MaxymVlasov MaxymVlasov merged commit 03ab152 into master Mar 26, 2025
47 checks passed
@MaxymVlasov MaxymVlasov deleted the init_git_blame_ignore branch March 26, 2025 17:24
@antonbabenko
Copy link
Copy Markdown
Owner

This PR is included in version 1.98.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants