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

Consolidate **/.gitignore files #161

Closed
wants to merge 2 commits into from
Closed

Consolidate **/.gitignore files #161

wants to merge 2 commits into from

Conversation

chartgerink
Copy link
Member

This PR merges the various .gitignore files in subfolders into the main .gitignore in the root directory of the repository.

It confused me to find multiple .gitignore files spread around the repo. I figured I would open this PR to see whether this is helpful.

I tried finding out what reasons there might be for doing this, but given that these are subfolders are without their one git history (they are not submodules) I did not see a reason to keep them separate.

If there's a specific reason for this, I would love to learn about it. I'll leave it to the code owner to decide what to do and respect that decision 😊

@pratikunterwegs
Copy link
Collaborator

pratikunterwegs commented Feb 5, 2024

Thanks @chartgerink - the separate files are autogenerated by {usethis}, and I trust their logic for where to note files to be ignored for the various use cases. Agreed they migh make it less clear why a particular file one expects to be tracked is not - so I don't mind unifying them if that's a common policy we choose to adopt. I think it's best to leave these files as they are for now though.

  • src/.gitignore is created by usethis::use_rcpp_*()
  • vignettes/.gitignore is created by usethis::use_vignette()
  • .github/.gitignore is created by usethis::use_github_action_*().

@pratikunterwegs
Copy link
Collaborator

Just as a note: I used to be in favour of submodules, and I know @joshwlambert has tried them too, but we don't use them in this project and I don't think there's a use case at the moment either.

@chartgerink
Copy link
Member Author

Thanks for the clarification @pratikunterwegs 🙏 I was not aware that it's a usethis thing. Appreciate the feedback 😊

I'll close this PR.

@chartgerink chartgerink closed this Feb 5, 2024
@chartgerink chartgerink deleted the chjh/gitignore branch February 5, 2024 11:32
@pratikunterwegs
Copy link
Collaborator

No worries - out of curiosity, is it considered best practice to have only one .gitignore? Not sure why {usethis} would depart from that if so.

Also as a note, {epidemics} along with {iraca} is among the more complex projects in terms of organisation. There are a couple of very early blog posts around how we organise and lint Rcpp packages which might help get a handle on it. And there are plenty of general Rcpp resources as well of course.

@chartgerink
Copy link
Member Author

Thanks! I will read those posts - good tip.

There is no hard prescription as to whether multiple or single .gitignore is best practice from git itself. It might vary depending on the specific language and community culture around it.

I only have come across it in the case of submodules myself. By induction, I would think it is best practice but there are too many unknowns for me to say that confidently :-) It seems however that the R community (especially usethis) seems to prefer this structure at the time.

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.

2 participants