summaryrefslogtreecommitdiffstats
path: root/src/dir.rs
AgeCommit message (Collapse)Author
2015-09-03Details view comments and tidy-upsBen S
2015-09-03Rename readdir -> read_dirBen S
2015-09-02Parallelise the details view!Ben S
This commit removes the threadpool in `main.rs` that stats each command-line argument separately, and replaces it with a *scoped* threadpool in `options/details.rs` that builds the table in parallel! Running this on my machine halves the execution time when tree-ing my entire home directory (which isn't exactly a common occurrence, but it's the only way to give exa a large running time) The statting will be added back in parallel at a later stage. This was facilitated by the previous changes to recursion that made it easier to deal with. There's a lot of large sweeping architectural changes. Here's a smattering of them: - In `main.rs`, the files are now passed around as vectors of files rather than array slices of files. This is because `File`s aren't `Clone`, and the `Vec` is necessary to give away ownership of the files at the appropriate point. - In the details view, files are now sorted *all* the time, rather than obeying the command-line order. As they're run in parallel, they have no guaranteed order anyway, so we *have* to sort them again. (I'm not sure if this should be the intended behaviour or not!) This means that the `Details` struct has to have the filter *all* the time, not only while recursing, so it's been moved out of the `recurse` field. - We use `scoped_threadpool` over `threadpool`, a recent addition. It's only safely used on Nightly, which we're using anyway, so that's OK! - Removed a bunch of out-of-date comments. This also fixes #77, mainly by accident :)
2015-08-26Propagate errors that occur during readdirBen S
Fixes #71 - the I/O error should now be displayed as an error, rather than as a panic. Also, fix some comments.
2015-08-26Scan for nested files on-demand, not all the timeBen S
This does a similar thing that we did with the xattrs, except with the nested files: it removes the 'this' field on File, and replaces it with a method (to_dir) that has the same effect. This means we get to remove a bunch of 'recurse' fields and parameters that really had no business being there! Now the table doesn't need to know whether it's going to need to list files recursively or not.
2015-08-25Display errors inline in the treeBen S
When tree mode is active, this will print out errors as another form of child node in the tree, instead of in one big block before any output. The 'this' field now holds the io::Result of the readdir call, rather than only a *successful* result.
2015-08-25Make Dir return an Iterator of files, not VecBen S
This is part of work to make the flow of files more iterator-able, rather than going in and out of vectors. Here, a Dir returns an iterator of files, rather than a pre-filled vector. For now, this removes the ability for error messages to be displayed. Will be added in later though!
2015-08-03Fix bug where Git repos were always queriedBen S
This is very slow (see #28) at the moment, so there's an option to switch off repo discovery. However, they were still always being queried. Now, if there's no Git option in the flags, it won't try to discover a repo.
2015-06-08Various unimportant style changesBen S
2015-05-12Move File fields to their own moduleBen S
2015-05-12Remove redundant importsBen S
2015-05-11Turn File into simply a data sourceBen S
And move all the rendering, ansi_term, colourful stuff into the output modules, which is the only place they should be used!
2015-05-10Finally, do the same for the Git column.Ben S
2015-05-10Do the same for the Git columnBen S
2015-04-23Use new io + path + fs libraries (LOTS OF CHANGES)Ben S
Exa now uses the new IO, Path, and Filesystem libraries that have been out for a while now. Unfortunately, the new libraries don't *entirely* cover the range of the old libraries just yet: in particular, to become more cross-platform, the data in `UnstableFileStat` isn't available in the Unix `MetadataExt` yet. Much of this is contained in rust-lang/rfcs#1044 (which is due to be implemented in rust-lang/rust#14711), but it's not *entirely* there yet. As such, this commits a serious loss of functionality: no symlink viewing, no hard links or blocks, or users or groups. Also, some of the code could now be optimised. I just wanted to commit this to sort out most of the 'teething problems' of having a different path system in advance. Here's an example problem that took ages to fix for you, just because you read this far: when I first got exa to compile, it worked mostly fine, except calling `exa` by itself didn't list the current directory. I traced where the command-line options were being generated, to where files and directories were sorted, to where the threads were spawned... and the problem turned out to be that it was using the full path as the file name, rather than just the last component, and these paths happened to begin with `.`, so it thought they were dotfiles.
2015-03-26Move all optional features into features moduleBen S
This module provides feature-specific implementations, and also dummy implementations for when they aren't supported by the system or OS. Doing it this way limits all the #[cfg(feature)] annotations, as we can now just include the module or not.
2015-03-22Upgrade to latest RustBen S
- old_path::Path isn't imported by default anymore - range -> ..
2015-03-22Apparently std::os::unix::osStrExt is now std::os::unix::ffi::OsStrExt.Eirik Schwenke
2015-03-02Temporary workaround for Path in libgit2-rsBen S
2015-02-22Improve matching of Git status entries to filesCorey Ford
The challenge is that the paths returned from libgit2's status listing are from the perspective of the Git repository and thus effectively relative to the working tree root, while the other paths we're manipulating are (potentially) relative to our current working directory. So, if those two aren't identical (if running from outside the working tree, or from a subdirectory), the paths won't match up. A reasonably reliable way around this is to resolve both types of paths to absolute paths before comparing them. This fixes #15 at a basic level, anyway. What still doesn't work: referring to the working tree or one of its descendants via a symlink. For that, we'd probably need to fully resolve symlinks in the file path. (The unwrap_or()'s are messy and will probably just result in missing status information, but then, what information could you hope to get without having both a current working directory and a Git working tree?)
2015-02-13Use ansi_term's awesome new continuation coloursBen S
2015-02-03Initial tree implementationBen S
There's still a lot to do, but this is actually *something*. The tree hierarchy is displayed using hashes at the start of a line. I want to have it just before the filename, but this will need some changes to the way that columns are handled.
2015-02-01What the heck?Ben S
2015-02-01Recurse into directoriesBen S
2015-01-28Upgrade to latest RustBen S
- Rename std::io to std::old_io
2015-01-28Oops, fix --no-default-features compilationBen S
2015-01-28Compare vectors, not stringsBen S
This is good for two reasons: 1) shorter code! 2) it won't fail if any of the filenames aren't valid UTF-8.
2015-01-28Implement Git status for directoriesBen S
2015-01-27Don't even show the column without the featureBen S
2015-01-27Preliminary Git support!Ben S
This is something that I've long wanted to add. It uses libgit2 as an optional dependency.
2015-01-26Make all fields of Dir privateBen S
2015-01-24Convert docs to standard formatBen S
2015-01-12rm trailing whitespaceBenjamin Sago
2014-12-12Miscellaneous little optimisationsBen S
- Prefer iter over into_iter where appropriate - Cut down on cloning
2014-12-12Whitespace fixesBen S
2014-11-26Remove unused lifetimeBen S
2014-11-24List files and directories separatelyBen S
This finally fixes the issue where trying to list a file causes a crash. Also, tidy up some of the uses of references.
2014-11-24I like aligning thingsBen S
2014-06-28Move to CargoBen S