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

Ignore editor temporary and backup files #232

Closed
zackw opened this issue Mar 24, 2017 · 3 comments
Closed

Ignore editor temporary and backup files #232

zackw opened this issue Mar 24, 2017 · 3 comments
Labels
A-CLI Area: CLI C-enhancement Category: Enhancement or feature request S-Wishlist Status: Wishlist

Comments

@zackw
Copy link

zackw commented Mar 24, 2017

I just noticed that mdbook serve (and presumably also other modes) don't ignore editor temporary files:

File changed: "/Users/zack/Documents/projects/rust/rust-book/second-edition/src/#ch01-02-hello-world.md#"
Building book...

All files whose basename matches one of the glob patterns #*#, .#*, *~, and *.swp are editor temporary/backup files; their appearance and disappearance should not trigger rebuilds. (There are probably more such glob patterns; this should be configurable in the .toml file, or better yet, read and honor .gitignore but that's a big task.)

@steveklabnik
Copy link
Member

read and honor .gitignore but that's a big task.

I think this is the right solution, and I'm pretty sure @BurntSushi published some of this stuff as part of his ripgrep work. So it shouldn't be too big a deal.

@BurntSushi
Copy link
Member

@steveklabnik That would be the ignore crate. Sadly, I fear I may have engineered it a bit too tightly to directory traversal. It biases strongly towards "do a directory traversal and ignore X according to some set of rules." Building it out to support other use cases will require real work. (The gitignore and glob matching itself should be reusable, but the higher level features of ignore might not be.)

@azerupi azerupi added A-CLI Area: CLI S-Wishlist Status: Wishlist C-enhancement Category: Enhancement or feature request and removed Type: Enhancement labels May 16, 2017
@ehuss
Copy link
Contributor

ehuss commented Apr 21, 2020

gitignore support has been added in #1044. I think that mostly covers the spirit of this issue, so if there are additional changes or enhancements desired (such as better defaults, or better git integration, or whatever), feel free to open a new issue.

@ehuss ehuss closed this as completed Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI C-enhancement Category: Enhancement or feature request S-Wishlist Status: Wishlist
Projects
None yet
Development

No branches or pull requests

5 participants