-
Notifications
You must be signed in to change notification settings - Fork 759
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Don’t add unwanted/overly broad .gitignore entries #2317
Comments
I think you should just not use |
To my horror, a friend let me know that my initial comment sounds quite aggressive. Please accept my apology, that truly wasn’t my intention and I hadn’t noticed the pushy phrasing. To clarify, the behaviour of Before submitting this issue my intent was to directly submit a PR with a candidate fix. But unfortunately this isn’t trivial, since merely substituting the strings ( |
I think updating it to use more strict The logic for writing the union lives in the usethis package, however I am not sure attempting to remove redundant non-exact matches is a good idea, I think there may be edge cases where people would not want this behavior. |
build_vignettes
helpfully adds the entriesdoc
andMeta
to.gitignore
, if they don’t already exist.However, more specific, existing entries are ignored. In particular, if the
.gitignore
file contains/doc/
and/Mate/
, the (redundant) entries are still added.Unfortunately, my project is actually using a nested
doc
directory, so that project doesn’t want to ignore this name.I’m happy to contribute a patch but I’m not sure how to do this well: ideally the
build_vignettes
should probably be maximally specific, and attempt to add/doc/
and/Meta/
instead ofdoc
andMeta
to avoid falsely matching unrelated directories. But such a change wouldn’t be backwards compatible (i.e. existing ‘devtools’ projects would now get redundant entries added to.gitignore
) so it doesn’t seem viable. Instead, maybe an option to skip automatic additions to.gitignore
, for users who rely on such directory names, might be conceivable.The text was updated successfully, but these errors were encountered: