git-annex adjust --lock-missing

Like --hide-missing the branch does not get updated when content
availability changes.

Seems to basically work, but sync does not update it yet.

Also, when a file is present and so unlocked, git mv followed by
git-annex sync results in the basis branch being updated to contain the
file with the new name, unlocked. This seems different than what
happens in an adjusted unlocked branch, where the commit propigates back
locked. Probably the reverse adjustment code needs to be improved to
handle this case.
This commit is contained in:
Joey Hess 2020-11-13 13:27:03 -04:00
parent 81f801c3b4
commit c8e49c5ef5
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
6 changed files with 106 additions and 23 deletions

View file

@ -19,6 +19,7 @@ optParser :: CmdParamsDesc -> Parser Adjustment
optParser _ =
(LinkAdjustment <$> linkAdjustmentParser)
<|> (PresenceAdjustment <$> presenceAdjustmentParser <*> maybeLinkAdjustmentParser)
<|> (LinkMissingAdjustment <$> linkMissingAdjustmentParser)
linkAdjustmentParser :: Parser LinkAdjustment
linkAdjustmentParser =
@ -45,6 +46,13 @@ presenceAdjustmentParser =
<> help "hide annexed files whose content is not present"
)
linkMissingAdjustmentParser :: Parser LinkMissingAdjustment
linkMissingAdjustmentParser =
flag' LockMissingAdjustment
( long "lock-missing"
<> help "lock files whose content is present; unlock rest"
)
seek :: Adjustment -> CommandSeek
seek = commandAction . start