Skip to content
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

Create .git-blame-ignore-revs #2254

Merged
merged 2 commits into from
Jan 7, 2022
Merged

Conversation

jonathantneal
Copy link
Contributor

Changes

  • Adds a .git-blame-ignore-revs file.
  • Useful for ignoring mass reformatting commits. ref
  • Supported in GitLens. ref
  • Support coming to GitHub (recently given high priority). ref
  • Works with git config blame.ignoreRevsFile .git-blame-ignore-revs

Testing

git config only

Docs

git config only

@changeset-bot
Copy link

changeset-bot bot commented Dec 22, 2021

⚠️ No Changeset found

Latest commit: a7476e6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Dec 22, 2021

✔️ Deploy Preview for astro-www ready!

🔨 Explore the source changes: a64dca3

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-www/deploys/61c39719be4d570007a352c0

😎 Browse the preview: https://deploy-preview-2254--astro-www.netlify.app

@netlify
Copy link

netlify bot commented Dec 22, 2021

✔️ Deploy Preview for astro-docs-2 ready!

🔨 Explore the source changes: a64dca3

🔍 Inspect the deploy log: https://app.netlify.com/sites/astro-docs-2/deploys/61c397198be63a0007e4e65e

😎 Browse the preview: https://deploy-preview-2254--astro-docs-2.netlify.app

@jasikpark
Copy link
Contributor

Nice! Might be worth adding git config --add blame.ignorerevsfile .git-blame-ignore-revs? Is it possible to commit that as a repo-local commit?

For me it added

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = https://github.com/withastro/astro.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
        remote = origin
        merge = refs/heads/main
[branch "jn.add-git-blame-ignore-revs"]
        remote = origin
        merge = refs/heads/jn.add-git-blame-ignore-revs
        github-pr-owner-number = "withastro#astro#2254"
+[blame]
+       ignorerevsfile = .git-blame-ignore-revs

Which I assume would be updated on push maybe? And then generally respected rather than requiring everyone to set it up?

@jasikpark
Copy link
Contributor

After that change to the git config Git Lens correctly ignored the mass formatting change!

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

I added a quick note about setting this up to CONTRIBUTING.md! Looks good to me.

@FredKSchott FredKSchott merged commit 35e0a22 into main Jan 7, 2022
@FredKSchott FredKSchott deleted the jn.add-git-blame-ignore-revs branch January 7, 2022 23:02
jonathantneal added a commit that referenced this pull request Jan 8, 2022
* Create .git-blame-ignore-revs

* docs: add note about `.git-blame-ignore-revs`

Co-authored-by: Nate Moore <nate@skypack.dev>
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.

4 participants