Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --one-file-system, --sort and --sortr #1027

Merged
merged 4 commits into from
Aug 26, 2018
Merged

add --one-file-system, --sort and --sortr #1027

merged 4 commits into from
Aug 26, 2018

Conversation

BurntSushi
Copy link
Owner

Closes #321, Closes #404

cc @okdana Mind checking if I got the completions right? If I got it this time, then I think I've grok'd it.

@okdana
Copy link
Contributor

okdana commented Aug 26, 2018

No errors in the stuff you added, but:

  • The exclusions for --threads should be changed from (--sort-files) to (sort) to make those groups mutually exclusive

  • Since you're keeping --sort-files around for a while, i might suggest retaining a hidden spec for it, which would look like !(threads)--sort-files. (You could also leave one for --no-sort-files, but it would be irritating because then you can't just make the whole group exclusive — and it's got be a pretty rarely used option anyway — so i'd leave that out)

  • I'd suggest changing the optarg description sortby to sort method; that'll make more sense in the description message that zsh produces

@okdana
Copy link
Contributor

okdana commented Aug 26, 2018

btw, to give some context for the changes you're making:

screen shot 2018-08-25 at 23 02 29

This commit adds a 'same_file_system' option to the walk builder. For
single threaded walking, it defers to the walkdir crate, which has the
same option. The bulk of this commit implements this flag for the parallel
walker. We add one very feeble test for this.

The parallel walker is now officially a complete mess.

Closes #321
This permits callers to sort entries by their full file path, which makes
it easy to query for various file statistics.

It would have been better to provide a comparator on DirEntry itself,
similar to how walkdir does it, but this seems to require quite a bit of
work to make the types work out, assuming we want to continue to use
walkdir's sorting support (we do).
These flags each accept one of five choices: none, path, modified,
accessed or created. The value indicates how the results are sorted.
For --sort, results are sorted in ascending order where as for --sortr,
results are sorted in descending order.

Closes #404
@BurntSushi
Copy link
Owner Author

@okdana I think I've fixed all of that!

Also, I spent half a day yak shaving. My default shell is now zsh. Let's see how this goes. :-)

@BurntSushi BurntSushi merged commit 40e310a into master Aug 26, 2018
@BurntSushi BurntSushi deleted the ag/features branch August 26, 2018 22:42
@BurntSushi
Copy link
Owner Author

@okdana I am pretty blown away by the auto completing for --colors specifically. Very nicely done.

@okdana
Copy link
Contributor

okdana commented Aug 26, 2018

Thanks! Let me know if you need anything re: zsh

@BurntSushi
Copy link
Owner Author

@okdana I think I might take you up on that! I sent you mail. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants