oldkeys --revision-range

Sponsored-by: Brett Eisenberg on Patreon
This commit is contained in:
Joey Hess 2023-08-22 15:00:29 -04:00
parent cf8b30c914
commit 5489c2cdd6
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 19 additions and 1 deletions

View file

@ -29,11 +29,16 @@ cmd = noCommit $ withAnnexOptions [annexedMatchingOptions] $
data OldKeysOptions = OldKeysOptions
{ fileOptions :: CmdParams
, revisionRange :: Maybe String
}
optParser :: CmdParamsDesc -> Parser OldKeysOptions
optParser desc = OldKeysOptions
<$> cmdParams desc
<*> optional (strOption
( long "revision-range" <> metavar "RANGE"
<> help "limit to a revision range"
))
seek :: OldKeysOptions -> CommandSeek
seek o = do
@ -71,7 +76,11 @@ seek o = do
, Param "--raw"
-- Avoid outputting anything except for the raw diff.
, Param "--pretty="
] ++ map File (fileOptions o)
]
++ case revisionRange o of
Nothing -> []
Just rr -> [Param rr]
++ map File (fileOptions o)
isfilemode m = case toTreeItemType m of
Just TreeFile -> True

View file

@ -23,6 +23,15 @@ repository.
# OPTIONS
* --revision-range=value
Only list old keys used in the specified range of revisions.
This works the same as the revision range option of `git log`.
See gitrevisions(7) for documentation about the format of this option.
For example, to list only keys used since the tag v1.0, use
`--revision-range=v1.0..HEAD`
* Also the [[git-annex-common-options]](1) can be used.
# SEE ALSO