-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Make serve and watch respect .gitignore #1045
Conversation
When editing files with some editors (e.g. vim) temporary files are constantly being modified causing mdbook serve and watch to constantly rebuild the project. To avoid this leverage the ignore crate to load the project's root .gitignore file and skip changes on files ignored.
Sorry, I'm a bit confused. Was it just coincidence that this and #1044 were opened within a few hours of each other? |
What's better than 1 PR... 2 PRs. Kidding, this was a coincidence. @segfaultsourcery this is my first code in Rust which I'm learning just now, better examples is likely not something you'll get from me any time soon 😄 . I'm fine with dropping this and just going with #1044 if you prefer. Only did this for learning and because the constant refreshing was annoying me. As long as we get something I'm happy. |
I've only been writing it for a couple of months, myself. I'm also happy either way, I just want the itch scratched. |
Let's go with yours @segfaultsourcery I'm not going to be able to put much time into this and you already got some feedback from r/rust which is great. Thanks for working on it. |
Oh I was just going to wait for input from the others on how to proceed.
Anyway, you have one very neat thing that I didn't think of, and that's
adding the command line param for enabling gitignore. In my case, it's just
always enabled. If you want, you can make a pull request to me so we both
get our names on this. I can also loop you in if I get any requests.
…On Thu, Oct 3, 2019, 20:48 Filipe Manco ***@***.***> wrote:
Let's go with yours @segfaultsourcery
<https://github.com/segfaultsourcery> I'm not going to be able to put
much time into this and you already got some feedback from r/rust which is
great. Thanks for working on it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1045>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABGF4MBDBKOS6CBRDGKKDKDQMY5BTANCNFSM4I44HQDA>
.
|
@segfaultsourcery I had no time to follow up on this, I'm glad your PR got merged. Once I have a bit of time I will make a new PR for the command line flag. |
Hey! No worries.
It turns out that they didn't want a flag (check the discussion in the
pull), so instead were searching backwards for a .gitignore through the
ancestors of the current folder.
I don't think it's released yet, but it does work if you `cargo install
--git` the master branch.
Just add a line with "*.swp" (I think it was for you?) and it should work.
…On Fri, Oct 18, 2019, 06:16 Filipe Manco ***@***.***> wrote:
@segfaultsourcery <https://github.com/segfaultsourcery> I had no time to
follow up on this, I'm glad your PR got merged. Once I have a bit of time I
will make a new PR for the command line flag.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1045>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGF4MDDZ7SKW3IQPUSFMWDQPE2BTANCNFSM4I44HQDA>
.
|
Awesome. Thanks for the work. This is great. |
When editing files with some editors (e.g. vim) temporary files are
constantly being modified causing mdbook serve and watch to constantly
rebuild the project.
To avoid this leverage the ignore crate to load the project's root
.gitignore file and skip changes on files ignored.