Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: hide files excluded by .gitignore
Fixes hmarr#14 This commit adds support for hiding files from output that have been excluded by .gitignore and friends. I've implemented a few version of this and settled on just `git ls-files` since it's likely going to be the most correct and maintainable solution. I've tried github.com/boyter/gocodewalker but it's a complex piece of machinery and was much slower on a repo of 15k files (Cilium) than just git ls-files. I also tried out github.com/ianlewis/go-gitignore directly, but it doesn't pick up .gitignore files in subdirs automatically, nor the system-wide gitignore. I figured since the overwhelming majority of users will be running this in CI where Git will always be present, relying on the canonical .gitignore implementation (git itself) is the safest option. Signed-off-by: Timo Beckers <[email protected]>
- Loading branch information