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

Approved and mergeable PRs 1 and 24 with conflicts already resolved #32

Closed
wants to merge 14 commits into from

Conversation

chadnetzer
Copy link
Collaborator

As my individual PRs are approved (but not yet merged), I'll produce an updated PR like this that resolves the conflicts amongst the individual PRs (due to them all being based on current master rather than ordered upon each other). This should mean that accepting multiple approved PRs is as simple as merging a single non-conflicting PR. This allows each PR to be individually reviewed, without having upstream to do the integration work. Test cases will verify the integrity of the integrated PRs.

This PR consists of the verbosity option update (PR #1) and the file size options (PR #24), approved by jamescassell.

wolfospealain and others added 14 commits July 2, 2018 04:27
Memory can be a problem over a large number of files. Added file-size and max-file-size to check only files of a certain size min, max or range. It is ultimately more important to check all identical files in a directory than check all files and run short on memory. It also provides a quick way to save space by hardlinking only the larger files.
A more specific name and consistent w/ options.max_file_size
Make verbosity checks consistently use "greater than", rather than
"greater than or equal".
Since it's a counter, rather than a boolean, 'verbosity' is a more
appropriate word.
Even though verbosity resets the value to zero on the first '-v'
encountered, if no '-v' the variable is initialized to None (at least in
Python 3)
There is a rare corner case when transitioning from old verbose option
arguments (-v num) to new (-v -v ...), that the OptionParser cannot
catch, when the given 'num' matches an existent directory name.

Add a safeguard to prevent scanning 'num' directories inadvertently when
old-style verbose arguments are still being used.  This *could* block
intentional cases where someone wants to legitimately scan a directory
named as a number.  This seems a rare case, though, and can be worked
around by not specifying the directory name directly after a '-v'
argument (or not using '-v').

An error message is printed to indicate the ambiguous argument, and the
code can be disabled by changing the default global boolean.
Eventually, this safeguard could be removed, when it's safe to assume
that users have transitioned to the new style verbosity arguments.
Separate from the regular file check, allowing further tests without a
long boolean chain, and use the stat_info attributes for consistency
with other parts of the code.
Simple tests to specify file sizes out of range of the test data, and
ensure that no changes were made (similar to a dry-run).
Addresses issue GH akaihola#1 and incorporates @wolfospealain verbosity changes.
Changes internal variable name to the more appropriate 'verbosity'.

Adds a safeguard against certain rare cases where an old-style verbose
numeric argument might be misinterpreted as an existent directory.
Should help better justify the transition to the new style.
Adds the file size options implemented by @wolfospealain, with argument
range checking and test cases.
@chadnetzer chadnetzer closed this Jul 7, 2018
@chadnetzer chadnetzer deleted the approved_PRs_1_24 branch July 7, 2018 10:57
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.

None yet

2 participants