fboender/multi-git-status

"find: ./.Trash: operation not permitted" appearing when run in home folder

Opened this issue · 3 comments

When I run the script in my home folder, I get the following type of output:

find: ./.Trash: Operation not permitted
./repo1: Needs push (main) Uncommitted changes
./repo2: Needs push (master) Uncommitted changes
...

I'm wondering if there's a way to change this behavior so that first line doesn't show up?

Wild guess, but perhaps this is related to this question on Stackoverflow? (Don't use the solution given in that question, it's a bad idea). Can you confirm that you're on mac?

I am on a Mac, yes. And I get the same operation not permitted warning with ls ~/.Trash

I've looked into it, but there doesn't seem to be a POSIX (cross platform / shell) way to exclude such directories. It is possible to exclude the .Trash dir itself, however find will still try to recurse into the directory and still runs into the problem. So I can't fix this in mgitstatus itself.

Unfortunately, I think the only solutions for you are to either create an alias in your shell profile that redirects the error output to /dev/null:

alias mgitstatus="mgitstatus 2>/dev/null"

Or move the Git projects to a sub folder in your home dir like ~/src or ~/projects.