lsd-rs / lsd

The next gen ls command
Apache License 2.0
13.06k stars 425 forks source link

Support gitignore #1071

Open theopomies opened 1 month ago

theopomies commented 1 month ago

Adds support for filtering out gitignored files

This feature adds a --gitignore CLI flag and a gitignore (optional) boolean key in the config file for filtering out gitignored files.

It makes use of the GitStatus and GitCache structures to provide this feature.

I wrote tests for the Config and Cli flag but couldn't figure out how to write integration tests, I didn't find any tests for the GitStatus or IgnoreGlobs features to take inspiration from.

This partially solves #218 and #342

TODO

muniu-bot[bot] commented 1 month ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: theopomies Once this PR has been reviewed and has the lgtm label, please assign zwpaper for approval by writing /assign @zwpaper in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/lsd-rs/lsd/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment