multi-git-status icon indicating copy to clipboard operation
multi-git-status copied to clipboard

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

Open nbbaier opened this issue 2 years ago • 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?

nbbaier avatar Mar 16 '23 04:03 nbbaier

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?

fboender avatar Mar 16 '23 06:03 fboender

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

nbbaier avatar Mar 16 '23 13:03 nbbaier

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.

fboender avatar Mar 17 '23 08:03 fboender