Please describe the problem.
git annex info prints several warnings:
annexed files in working tree: warning: could not open directory '.Spotlight-V100/': Operation not permitted
warning: could not open directory '.Trashes/': Operation not permitted
warning: could not open directory '.fseventsd/': Permission denied
What steps will reproduce the problem?
- Create an APFS volume on MacOS
- Initialize a git repo and annex in that volume dir (e.g.
/Volumes/my-annex) - Add a
.gitignoreas seen below git annex info
.gitignore:
.Spotlight-V100
.Trashes
.fseventsd
What version of git-annex are you using? On what operating system?
git-annex version: 10.20230407 MacOS 12.6.2
Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
Yes, lots! 

It's actually git that is displaying that message. Specifically
git ls-files --othersNote that command is specifically supposed to list files that have been gitignored. And unfortunately there's no way to get a similar list of files while honoring .gitignore.
git-annex addbehaves the same way, and obviously it does need to usegit ls-files --othersor some equivilant, since it needs a way to list untracked files.The reason why
git-annex infodoes is because it reuses some code fromgit-annex unused. In the latter case, 6fd2935a5af196d22e27c423acac67b5d79ea6a6 gives a rationalle, to look for unstaged annex symlinks. That certianly makes sense forgit-annex unused, because runningmv foo baron an annexed file shouldn't make the annex content be considered unused, unlikerm foo.And it also means that
git-annex infoknows about unstaged symlinks to annexed files, eg:So, while it would be possible to change
git annex infoto not behave this way,git-annex unusedandgit-annex addstill would.So I'm inclinded not to change this. It would, I think be reasonable to talk to the git developers about whether git ls-files needs to display permission denied errors in this situation. Or perhaps there could be a mode added to ls-files that lists untracked files but honors gitignores.