hmarr / codeowners

🔒 Command line tool and Go library for CODEOWNERS files
MIT License
163 stars 19 forks source link

codeowners output incomplete in (non-main) git worktree #27

Open HarryWeppner opened 3 months ago

HarryWeppner commented 3 months ago

It appears that codeowners assumes it is running in the main work tree. When run in a non-main work tree, its results differ vastly from those in the main work tree. In the non-main work tree, I only see three unowned dot-files while there are thousands of unowned files in the main work tree.

rwese commented 2 months ago

If you could provide a simple example to reproduce this state it would be nice.

What I can tell is that the current implementation does no detection of any git related information, stepping down into a lower directory where a new CODEOWNERS file might by applicable is not implemented, if we assume it works like .gitignore they would add their matches, overwriting the owner for the matching rule.

In my screenshot you can see that the 'root' cmd folder matches, but the added worktree doesn't.

Screenshot 2024-06-01 at 06 08 40