Skip to content

.gitignore omits .DS_Store, .Rhistory, and .Rproj.user, which only a global gitignore is covering #84

Description

@d-morrison

.DS_Store, .Rhistory, and .Rproj.user/ are all present in a working checkout of this repo and are all ignored only by a machine-local global gitignore:

$ git check-ignore -v .DS_Store .Rhistory .Rproj.user
/Users/<user>/.gitignore:5:.DS_Store      .DS_Store
/Users/<user>/.gitignore:2:.Rhistory      .Rhistory
/Users/<user>/.gitignore:1:.Rproj.user    .Rproj.user

$ git config --get core.excludesFile
~/.gitignore

The repo's own .gitignore covers /.quarto/, /_site/, /_freeze/, /*.deb, .positai, and **/*.quarto_ipynb — none of these three.

Nothing is tracked today (git ls-files finds no match), so this is a latent gap rather than a live defect. It bites whoever does not have that global config: a new collaborator, a CI job, or an agent working in a container. A git add -A from any of those commits editor and OS residue, and .Rproj.user/ in particular is a directory of local RStudio state.

The reason it is worth closing rather than leaving to convention is that the protection is invisible from inside the repo. Someone checking whether the repo is safe reads .gitignore, sees the Quarto entries, and has no way to notice that three more rules are being supplied from outside it.

Patch

 /.quarto/
 /_site/
 /_freeze/
 /*.deb
 .positai
+
+# Editor and OS residue. Do not rely on a contributor's global gitignore --- it
+# is invisible from inside the repo, so someone reading this file cannot tell
+# these are covered.
+.DS_Store
+.Rhistory
+.Rproj.user/
 
 **/*.quarto_ipynb

Related

Morrison-Lab/gha#606 is adding a check-junk-files workflow that fails on tracked .DS_Store and friends. That catches the problem after it happens; this closes the door beforehand. Worth adopting the workflow here too once it lands, alongside the rest of the gha migration in #82.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions