diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-05-14 15:31:38 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-05-14 15:31:38 -0400 |
commit | 9ef82700e53d82b38aed603c5c8033d09fe3cf3f (patch) | |
tree | 0cf4f7521c9f7c0d96b4a360f616348946728cd2 /doc | |
parent | 76e69deadf246c95ac4a49b7b72af49a742d235b (diff) |
unused: Add --used option, which can specify a set of refs to consider used, rather than the default of considering all refs used.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/git-annex-unused.mdwn | 32 | ||||
-rw-r--r-- | doc/todo/unused_by_refspec.mdwn | 5 |
2 files changed, 36 insertions, 1 deletions
diff --git a/doc/git-annex-unused.mdwn b/doc/git-annex-unused.mdwn index d59ef2abc..fbb371995 100644 --- a/doc/git-annex-unused.mdwn +++ b/doc/git-annex-unused.mdwn @@ -26,7 +26,37 @@ For example, to move all unused data to origin: * `--from=remote` - Check for unused data on a remote. + Check for unused data that is located on a remote. + +* `--used-refspec=+ref:-ref` + + By default, any data that the work tree uses, or that any refs in the git + repository point to is considered to be used. If you only want to use + some refs, you can use this option to specify the ones to use. Data that + is not in the specified refs (and not used by the work tree) will then be + considered unused. + +# REFSPEC + +The refspec format for --used-refspec is a colon-separated list of +additions and removals of refs. For example: + + +refs/heads/*:+HEAD^:+refs/tags/*:-refs/tags/old-tag + +This adds all refs/heads/ refs, as well as the previous version +of HEAD. It also adds all tags, except for old-tag. + +This refspec is processed by starting with an empty set of refs, +and walking the list in order from left to right. + +* Each + using a glob is matched against all relevant refs + (a subset of `git show-ref`) and all matching refs are added + to the set. + For example, "+refs/remotes/*" adds all remote refs. +* Each + without a glob adds the literal value to the set. + For example, "+HEAD^" adds "HEAD^". +* Each - is matched against the set of refs accumulated so far. + Any matching refs are removed from the set. # SEE ALSO diff --git a/doc/todo/unused_by_refspec.mdwn b/doc/todo/unused_by_refspec.mdwn index 781425264..ea84599bb 100644 --- a/doc/todo/unused_by_refspec.mdwn +++ b/doc/todo/unused_by_refspec.mdwn @@ -33,4 +33,9 @@ refspec in order. the SHAs that the refs point to, so -refs/heads/master does not remove +HEAD). +Hmm, unused currently does a separate pass to find files used in the work +tree. I think it's best to keep that as-is. + --[[Joey]] + +> [[done]] --[[Joey]] |