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
.gitignore
as 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 --others
Note 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 add
behaves the same way, and obviously it does need to usegit ls-files --others
or some equivilant, since it needs a way to list untracked files.The reason why
git-annex info
does 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 bar
on an annexed file shouldn't make the annex content be considered unused, unlikerm foo
.And it also means that
git-annex info
knows about unstaged symlinks to annexed files, eg:So, while it would be possible to change
git annex info
to not behave this way,git-annex unused
andgit-annex add
still 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.