Commit graph

106 commits

Author SHA1 Message Date
Joey Hess
4f1fea1a85 fix memory leak
filterM is not a good idea if you were streaming in a large list of files.

Fixing this memory leak that I introduced earlier today was a PITA because
to avoid the filterM, it's necessary to do the filtering only after
building up the data structures like BackendFile, and that means each
separate data structure needs it own function to apply the filter,
at least in this naive implementation.

There is also a minor performance regression, when using copy/drop/get/fsck
with a filter, git is now asked to look up attributes for all files,
since that now comes before the filter is applied. This is only a very
minor thing, since getting the attributes is very fast and --exclude was
probably not typically used to speed it up.
2011-09-18 22:40:31 -04:00
Joey Hess
33cd1ffbfe make find show files meeting limits, even when not present
find: Rather than only showing files whose contents are present, when used
with --exclude --copies or --in, displays all files that match the
specified conditions.

Note that this is a behavior change for find --exclude! Old behavior
can be gotten with find --in . --exclude=...
2011-09-18 20:42:15 -04:00
Joey Hess
9da23dff78 --copies=N can be used to make git-annex only operate on files with the specified number of copies.
(And --not --copies=N for the inverse.)
2011-09-18 20:23:08 -04:00
Joey Hess
1fc3ee2423 add --in limit 2011-09-18 20:14:18 -04:00
Joey Hess
b9aa944b09 add --and --or --not -( and -)
I dislike -( and -), but without using a different option parser, can't
easily use bare parens.

--and and --or will become more useful once there are more interesting
limits than --exclude
2011-09-18 18:21:42 -04:00
Joey Hess
8a5a92480b refactor --exclude to use Utility.Matcher
This should change no behavior, but opens the poissibility to use the
matcher for other sorts of limits on which files git-annex processes.
2011-09-18 17:47:49 -04:00