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