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

Stop ignoring .rs.bk files; rustfmt hasn't generated them in years #7647

Merged
merged 1 commit into from
Dec 2, 2019

Conversation

joshtriplett
Copy link
Member

@joshtriplett joshtriplett commented Dec 2, 2019

cargo currently generates a .gitignore file that ignores .rs.bk files,
historically because rustfmt would sometimes generate such files.
However, rustfmt and cargo fmt don't generate backup files by default
(only when requested), and even when requested, they generate .bk files,
not .rs.bk files (as of rustfmt commit
fad903fd14ad0df045dc574cac0717312860c380 in 2017). And nobody seems to
have noticed or complained since then, likely because rustfmt doesn't
generate backup files by default.

rustfmt also plans to deprecate the --backup option entirely, in rustfmt
2.0, and instead always rely on version control to track changes.

In addition, these types of ignores, just like ignores of editor backup
files, don't belong in .gitignore; they belong in people's personal
ignore files, such as ~/.config/git/ignore. See
https://julien.danjou.info/properly-managing-your-gitignore/ for further
explanation of that.

Given all three of those factors, drop the code to add **/*.rs.bk to
.gitignore, and update tests accordingly.

cargo currently generates a .gitignore file that ignores .rs.bk files,
historically because rustfmt would sometimes generate such files.
However, rustfmt and cargo fmt don't generate backup files by default
(only when requested), and even when requested, they generate .bk files,
not .rs.bk files (as of rustfmt commit
fad903fd14ad0df045dc574cac0717312860c380 in 2017). And nobody seems to
have noticed or complained since then, likely because rustfmt doesn't
generate backup files by default.

rustfmt also plans to deprecate the --backup option entirely, in rustfmt
2.0, and instead always rely on version control to track changes.

In addition, these types of ignores, just like ignores of editor backup
files, don't belong in .gitignore; they belong in people's personal
ignore files, such as ~/.config/git/ignore.  See
https://julien.danjou.info/properly-managing-your-gitignore/ for further
explanation of that.

Given all three of those factors, drop the code to add **/*.rs.bk to
.gitignore, and update tests accordingly.
@rust-highfive
Copy link

r? @Eh2406

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 2, 2019
@Eh2406
Copy link
Contributor

Eh2406 commented Dec 2, 2019

Looks ok to me.

@bors r+

@bors
Copy link
Collaborator

bors commented Dec 2, 2019

📌 Commit 997a6d5 has been approved by Eh2406

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 2, 2019
@bors
Copy link
Collaborator

bors commented Dec 2, 2019

⌛ Testing commit 997a6d5 with merge 4dacb9d...

bors added a commit that referenced this pull request Dec 2, 2019
Stop ignoring .rs.bk files; rustfmt hasn't generated them in years

cargo currently generates a .gitignore file that ignores .rs.bk files,
historically because rustfmt would sometimes generate such files.
However, rustfmt and cargo fmt don't generate backup files by default
(only when requested), and even when requested, they generate .bk files,
not .rs.bk files (as of rustfmt commit
fad903fd14ad0df045dc574cac0717312860c380 in 2017). And nobody seems to
have noticed or complained since then, likely because rustfmt doesn't
generate backup files by default.

rustfmt also plans to deprecate the --backup option entirely, in rustfmt
2.0, and instead always rely on version control to track changes.

In addition, these types of ignores, just like ignores of editor backup
files, don't belong in .gitignore; they belong in people's personal
ignore files, such as `~/.config/git/ignore`.  See
https://julien.danjou.info/properly-managing-your-gitignore/ for further
explanation of that.

Given all three of those factors, drop the code to add `**/*.rs.bk` to
.gitignore, and update tests accordingly.
@bors
Copy link
Collaborator

bors commented Dec 2, 2019

☀️ Test successful - checks-azure
Approved by: Eh2406
Pushing 4dacb9d to master...

@bors bors merged commit 997a6d5 into rust-lang:master Dec 2, 2019
@joshtriplett joshtriplett deleted the gitignore-no-bk branch December 2, 2019 21:21
bors added a commit to rust-lang/rust that referenced this pull request Dec 4, 2019
Update cargo

11 commits in 750cb1482e4d0e74822cded7ab8b3c677ed8b041..626f0f40efd32e6b3dbade50cd53fdfaa08446ba
2019-11-23 23:06:36 +0000 to 2019-12-03 16:53:04 +0000
- Change some texts to links in README (rust-lang/cargo#7652)
- Update config and environment variable docs. (rust-lang/cargo#7650)
- Stop ignoring .rs.bk files; rustfmt hasn't generated them in years (rust-lang/cargo#7647)
- Various contributing docs updates. (rust-lang/cargo#7642)
- Stabilize profile-overrides. (rust-lang/cargo#7591)
- Update comment about ResolveVersion default version. (rust-lang/cargo#7637)
- Update tests for slight wording change in rustdoc error message. (rust-lang/cargo#7641)
- Remove dep_targets. (rust-lang/cargo#7626)
- vendor: don't use canonical path in .cargo/config (rust-lang/cargo#7629)
- Minor testsuite organization. (rust-lang/cargo#7628)
- Remove failing plugin tests. (rust-lang/cargo#7630)
JohnTitor added a commit to JohnTitor/gitignore that referenced this pull request Aug 9, 2020
This is no longer used by rustfmt anymore; see rust-lang/cargo#7647
berthj193 pushed a commit to toptal/gitignore that referenced this pull request Oct 1, 2020
This is no longer used by rustfmt anymore; see rust-lang/cargo#7647
jnqnfe added a commit to jnqnfe/term-ctrl-rust that referenced this pull request Dec 4, 2020
jnqnfe added a commit to jnqnfe/gong that referenced this pull request Dec 4, 2020
@ehuss ehuss added this to the 1.41.0 milestone Feb 6, 2022
lovelypuppy0607 added a commit to lovelypuppy0607/gitignore-1 that referenced this pull request May 11, 2023
This is no longer used by rustfmt anymore; see rust-lang/cargo#7647
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants