Xuyuanp / nerdtree-git-plugin

A plugin of NERDTree showing git status
Do What The F*ck You Want To Public License
2.08k stars 150 forks source link

Ignore 'warning: could not open directory' #165

Closed ebardie closed 4 years ago

ebardie commented 4 years ago

Description of Changes

Closes #164

Ignore "warning: could not open .* Permission denied" failure cases when getting git status.

Xuyuanp commented 4 years ago

Thanks for your contribution!

Should we ignore all the warning lines in stderr callback?

ebardie commented 4 years ago

On 20/09/2020 04:08, Xuyuan Pang wrote:

Thanks for your contribution!

Not at all. Thank you for the plugin! :)

Should we ignore all the |warning| lines in stderr callback?

Possibly, but we don't want to mask other errors the user would want to know about. Since that's an unknown factor, I thought this was the safest approach for now. It's easy to adapt, if-and-when other suitable cases show up.

The only other question is the relative performance impact of the more complicated regex including the '.*', but this is likely negligible.

In any case prepending a '^' to the regex would be a good idea because we're only interested when the error message starts with 'warning:', so I'll do that and push the commit again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Xuyuanp/nerdtree-git-plugin/pull/165#issuecomment-695585040, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFQ5NNZRHON63TIAFQ7LO3SGVW25ANCNFSM4RTDXCWA.