It makes sense to consider that a directory has the aggregated status of all the files under it.
The exception is that for the ignored status, it’s more useful and intuitive to consider that it applies to everything under it.
- A directory containing an ignored file is no longer considered ignored
- A file inside an ignored directory is now considered ignored
The flags --git and --git-ignore are caught early during options parsing, so no more checking for git feature is done elsewhere.
Since --git-ignore depends on git too since recently, remove it from help when git feature is disabled.
Extended attributes now don’t artificially depends on git feature being enabled.
This commit fixes a couple of Clippy warnings, and adds the list of lints we're OK with.
It does raise some important warnings, such as those to do with casting, which aren't allowed so they can be fixed later.
I read through every file and applied a couple of rustfmt suggestions. The brace placement and alignment of items on similar lines has been made consistent, even if neither are rustfmt's default style (a file has been put in place to enforce this). Other changes are:
• Alphabetical imports and modules
• Comma placement at the end of match blocks
• Use newlines and indentation judiciously
• Spaces around associated types
• Spaces after negations (it makes it more clear imho)
• Comment formatting
• Use early-returns and Optional `?` where appropriate
These are holdovers from how I used to write Rust ("back in the day" of 2014). There are still some places in the code where I think it's worth glob-importing enums, but not these places.
This commit makes changes to the way variables are referenced:
• Make types Copy when possible
• Make methods take `self` instead of `&self` where possible (trivially_copy_pass_by_ref)
• Remove unnecessary borrowing (needless_ref)
• Remove unnecessary cloning (clone_on_copy)
• Remove `ref` from match arms where possible (new Rust match ergonomics)
This commit uses Clippy to fix all the 'use_self' warnings. Using Self instead of the type name has been good Rust style for a while now, and it's become the style I'm used to seeing.
This commit removes the env_logger dependency, replacing it with a simple implementation. Doing so removes like ten other transitive dependencies that no longer need to be included in the build.
It also gains the ability to enable trace-level logging. The users crate, which contains such logging statements as of the version I published a few days ago, has been upgraded to celebrate.
Also, change the log imports to globs. I'm only interested that a file doing logging, not what level it's logging at.
This was an unintended consequence of #653. The Files iterator stopped using IgnoreCache and started using GitCache, which would always populated when the `--git` option was passed, without checking whether files were meant to be ignored. This meant that passing `--git` started ignoring files even without `--git-ignore`.
The solution for now is to explicitly pass the flag around, which probably should be a better type than bool but isn't. This makes the git-ignoring-related extended tests pass.
Using --octal_permissions will insert another column before the existing
permissions where permissions are encoded using octal values as
requested in #316
Previously if a timestamp was unavailable, it defaulted to the epoch.
Prior to this it defaulted to a zero duration.
Switch to an Option<SystemTime> and move the handling of unavailable
timestamps to rendering.
Instead of returning a Duration since the epoch from file metadata,
which cannot represent times before it, return the SystemTime directly.
Move conversion closer to where it's needed, and perform it infallibly.
- Checking on a directory doesn’t tell us if supported elsewhere
(some filesystems, like tmpfs, don’t support created time)
- We want to be able to display a column even if some subfiles or
subdirectories don’t support it
So now if unsupported a time of zero is used, and displayed as `-`
Added checks to `file.rs` to ensure that file's metadata exists after `UNIX_EPOCH`.
If the file was accessed/modified/created after UNIX_EPOCH, the current day is displayed.