* Improve handling of some .git/annex/ subdirectories being on other
filesystems, in the bittorrent special remote, and youtube-dl
integration, and git-annex addurl.
+ * Added --anything (and --nothing). Eg, git-annex find --anything
+ will list all annexed files whether or not the content is present.
+ This is slightly faster and clearer than --include=* or --exclude=*
-- Joey Hess <id@joeyh.name> Mon, 12 Dec 2022 13:04:54 -0400
<> help "match files smaller than a size"
<> hidden
)
+ , annexFlag (setAnnexState Limit.addAnything)
+ ( long "anything"
+ <> help "match all files"
+ <> hidden
+ )
+ , annexFlag (setAnnexState Limit.addNothing)
+ ( long "nothing"
+ <> help "don't match any files"
+ <> hidden
+ )
]
combiningOptions :: [AnnexOption]
{- user-specified limits on files to act on
-
- - Copyright 2011-2021 Joey Hess <id@joeyh.name>
+ - Copyright 2011-2022 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
isunused k = S.member k <$> unusedKeys
+{- Adds a limit that matches anything. -}
+addAnything :: Annex ()
+addAnything = addLimit (Right limitAnything)
+
{- Limit that matches any version of any file or key. -}
limitAnything :: MatchFiles Annex
limitAnything = MatchFiles
, matchNeedsLocationLog = False
}
+{- Adds a limit that never matches. -}
+addNothing :: Annex ()
+addNothing = addLimit (Right limitNothing)
+
{- Limit that never matches. -}
limitNothing :: MatchFiles Annex
limitNothing = MatchFiles
currently present. Specifying any of the matching options will override
this default behavior.
- To list all annexed files, present or not, specify `--include "*"`.
+ To list all annexed files, present or not, specify `--anything`.
To list annexed files whose content is not present, specify `--not --in=here`
This is only available to use when git-annex was built with the
MagicMime build flag.
+* `--anything`
+
+ Always matches. One way this can be useful is `git-annex find --anything`
+ will list all annexed files, whether their content is present or not.
+
+* `--nothing`
+
+ Never matches. (Same as `--not --anything`)
+
* `--not`
Inverts the next matching option. For example, to match
[[!meta author=yoh]]
[[!tag projects/datalad]]
+
+> [[done]]; added --anything (and --nothing). --[[Joey]]
--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2022-12-20T19:21:34Z"
+ content="""
+Using --copies necessarily loads up the location tracking log for
+each file, which does add overhead.
+
+Any other matching option that matches everything will work just as well
+for you. I think that `git-annex find --include='*'` is the best thing
+currently available. Indeed, the git-annex-find man page suggests to use
+that. The only overhead is an unncessary glob match, which
+should be almost unmeasurable.
+
+It does seem like it might be worth adding --anything that simply matches
+anything. Preferred content expressions already support "anything". And
+`git-annex find --anything` makes sense and is easier to type.
+
+But, you'll probably be better off using `--include='*'` since it works
+with older versions of git-annex.
+
+(--all is the wrong name for such an option since it already has another
+meaning, although I don't think it makes sense for `git-annex find` to
+support --all, it has certianly been requested before by people who want to
+generalize that existing meaning..)
+"""]]