summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-01-18 14:58:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-01-18 14:58:56 -0400
commitb16851705701be534eee93e2ac83b92f38d03874 (patch)
tree0931ebe2a21c7090b0ea84ec96b86be7b66bb96c
parent842ca9c4b684ec21b9e5a99b3742db5f36a1440f (diff)
Allow --all to be mixed with matching options like --copies and --in (but not --include and --exclude).
-rw-r--r--Seek.hs5
-rw-r--r--debian/changelog2
-rw-r--r--doc/git-annex.mdwn28
-rw-r--r--doc/preferred_content.mdwn2
4 files changed, 24 insertions, 13 deletions
diff --git a/Seek.hs b/Seek.hs
index 4b3281a56..3c84814f5 100644
--- a/Seek.hs
+++ b/Seek.hs
@@ -158,7 +158,10 @@ withKeyOptions keyop fallbackop params = do
go a = do
unless (null params) $
error "Cannot mix --all or --unused with file names."
- map keyop <$> a
+ matcher <- Limit.getMatcher
+ map (process matcher) <$> a
+ process matcher k = ifM (matcher $ MatchingKey k)
+ ( keyop k , return Nothing)
prepFiltered :: (FilePath -> CommandStart) -> Annex [FilePath] -> Annex [CommandStart]
prepFiltered a fs = do
diff --git a/debian/changelog b/debian/changelog
index 0b5845835..7dd801906 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,8 @@ git-annex (5.20140118) UNRELEASED; urgency=medium
* Remove --json option from commands not supporting it.
* status: Support --json.
* list: Fix specifying of files to list.
+ * Allow --all to be mixed with matching options like --copies and --in
+ (but not --include and --exclude).
-- Joey Hess <joeyh@debian.org> Sat, 18 Jan 2014 11:54:17 -0400
diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn
index badd4bde9..a3c52458f 100644
--- a/doc/git-annex.mdwn
+++ b/doc/git-annex.mdwn
@@ -601,7 +601,7 @@ subdirectories).
finds files in the current directory and its subdirectories.
By default, only lists annexed files whose content is currently present.
- This can be changed by specifying file matching options. To list all
+ This can be changed by specifying matching options. To list all
annexed files, present or not, specify `--include "*"`. To list all
annexed files whose content is not present, specify `--not --in=here`
@@ -643,7 +643,7 @@ subdirectories).
To only show the data that can be gathered quickly, use `--fast`.
When a directory is specified, shows a differently formatted info
- display for that directory. In this mode, all of the file matching
+ display for that directory. In this mode, all of the matching
options can be used to filter the files that will be included in
the information.
@@ -835,8 +835,6 @@ subdirectories).
normal behavior is to only operate on specified files in the working
tree.
- Note that --all overrides any other file matching options.
-
* `--unused`
Operate on all data that has been determined to be unused by
@@ -942,7 +940,7 @@ subdirectories).
Overrides git configuration settings. May be specified multiple times.
-# FILE MATCHING OPTIONS
+# MATCHING OPTIONS
These options can all be specified multiple times, and can be combined to
limit which files git-annex acts on.
@@ -962,6 +960,8 @@ file contents are present at either of two repositories.
--exclude='*.mp3' --exclude='subdir/*'
+ Note that this will not match anything when using --all or --unused.
+
* `--include=glob`
Skips files not matching the glob pattern. (Same as `--not --exclude`.)
@@ -969,6 +969,8 @@ file contents are present at either of two repositories.
--include='*.mp3' --or --include='*.ogg'
+ Note that this will not skip anything when using --all or --unused.
+
* `--in=repository`
Matches only files that git-annex believes have their contents present
@@ -1024,34 +1026,38 @@ file contents are present at either of two repositories.
Matches files that the preferred content settings for the repository
make it want to get. Note that this will match even files that are
already present, unless limited with e.g., `--not --in .`
+
+ Note that this will not match anything when using --all or --unused.
* `--want-drop`
Matches files that the preferred content settings for the repository
make it want to drop. Note that this will match even files that have
already been dropped, unless limited with e.g., `--in .`
+
+ Note that this will not match anything when using --all or --unused.
* `--not`
- Inverts the next file matching option. For example, to only act on
+ Inverts the next matching option. For example, to only act on
files with less than 3 copies, use `--not --copies=3`
* `--and`
- Requires that both the previous and the next file matching option matches.
+ Requires that both the previous and the next matching option matches.
The default.
* `--or`
- Requires that either the previous, or the next file matching option matches.
+ Requires that either the previous, or the next matching option matches.
* `-(`
- Opens a group of file matching options.
+ Opens a group of matching options.
* `-)`
- Closes a group of file matching options.
+ Closes a group of matching options.
# PREFERRED CONTENT
@@ -1061,7 +1067,7 @@ using `git annex vicfg` or `git annex wanted`.
They are used by the `--auto` option, and by the git-annex assistant.
The preferred content settings are similar, but not identical to
-the file matching options specified above, just without the dashes.
+the matching options specified above, just without the dashes.
For example:
exclude=archive/* and (include=*.mp3 or smallerthan=1mb)
diff --git a/doc/preferred_content.mdwn b/doc/preferred_content.mdwn
index 40364011e..2e12dce49 100644
--- a/doc/preferred_content.mdwn
+++ b/doc/preferred_content.mdwn
@@ -16,7 +16,7 @@ If a file matches, it's preferred to have its content stored in the
repository. If it doesn't, it's preferred to drop its content from
the repository (if there are enough copies elsewhere).
-The expressions are very similar to the file matching options documented
+The expressions are very similar to the matching options documented
on the [[git-annex]] man page. At the command line, you can use those
options in commands like this: