fix reversion on skipping dead keys in --all/bare
Fix a reversion that made dead keys not be skipped when operating on all keys via --all or in a bare repo. (Introduced in version 8.20200720) Also, improved the documentation of git-annex-dead, it does not only apply to fsck --all. Also, made git-annex fsck, when run on a file whose key is dead, display that. Before, it displayed that only when run with --all, but with this fix, it skips dead keys with --all. But it can still be run on a file that uses a dead key, and displaying "This key is dead" explains to the user why it does not consider missing content for it to be a problem. Sponsored-by: k0ld on Patreon
This commit is contained in:
parent
b7f13181ad
commit
eefc026370
5 changed files with 24 additions and 4 deletions
|
@ -10,6 +10,9 @@ git-annex (10.20220823) UNRELEASED; urgency=medium
|
||||||
process, rather than repeatedly prompting.
|
process, rather than repeatedly prompting.
|
||||||
* Use curl for downloads from git remotes when annex.url-options
|
* Use curl for downloads from git remotes when annex.url-options
|
||||||
and other git configs are set.
|
and other git configs are set.
|
||||||
|
* Fix a reversion that made dead keys not be skipped when operating on
|
||||||
|
all keys via --all or in a bare repo.
|
||||||
|
(Introduced in version 8.20200720)
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Mon, 29 Aug 2022 15:03:04 -0400
|
-- Joey Hess <id@joeyh.name> Mon, 29 Aug 2022 15:03:04 -0400
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ import CmdLine.GitAnnex.Options
|
||||||
import CmdLine.Action
|
import CmdLine.Action
|
||||||
import Logs
|
import Logs
|
||||||
import Logs.Unused
|
import Logs.Unused
|
||||||
|
import Logs.Location
|
||||||
import Types.Transfer
|
import Types.Transfer
|
||||||
import Logs.Transfer
|
import Logs.Transfer
|
||||||
import Types.Link
|
import Types.Link
|
||||||
|
@ -283,7 +284,8 @@ withKeyOptions' ko auto mkkeyaction fallbackaction worktreeitems = do
|
||||||
let go reader = reader >>= \case
|
let go reader = reader >>= \case
|
||||||
Just (k, f, content) -> checktimelimit (discard reader) $ do
|
Just (k, f, content) -> checktimelimit (discard reader) $ do
|
||||||
maybe noop (Annex.Branch.precache f) content
|
maybe noop (Annex.Branch.precache f) content
|
||||||
keyaction Nothing (SeekInput [], k, mkActionItem k)
|
unlessM (checkDead k) $
|
||||||
|
keyaction Nothing (SeekInput [], k, mkActionItem k)
|
||||||
go reader
|
go reader
|
||||||
Nothing -> return ()
|
Nothing -> return ()
|
||||||
Annex.Branch.overBranchFileContents getk go >>= \case
|
Annex.Branch.overBranchFileContents getk go >>= \case
|
||||||
|
|
|
@ -574,7 +574,7 @@ checkKeyNumCopies key afile numcopies = do
|
||||||
(deadlocations, safelocations) <- trustPartition DeadTrusted otherlocations
|
(deadlocations, safelocations) <- trustPartition DeadTrusted otherlocations
|
||||||
let present = length safelocations
|
let present = length safelocations
|
||||||
if present < fromNumCopies numcopies
|
if present < fromNumCopies numcopies
|
||||||
then ifM (pure (not hasafile) <&&> checkDead key)
|
then ifM (checkDead key)
|
||||||
( do
|
( do
|
||||||
showLongNote $ "This key is dead, skipping."
|
showLongNote $ "This key is dead, skipping."
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
[[!comment format=mdwn
|
||||||
|
username="joey"
|
||||||
|
subject="""comment 4"""
|
||||||
|
date="2022-09-13T18:21:13Z"
|
||||||
|
content="""
|
||||||
|
This was a reversion.
|
||||||
|
|
||||||
|
In 2017, [[!commit bcf276655c04f36e021f091240ed2dc8211924fd]]
|
||||||
|
made --all skip dead keys, by modifying loggedKeys.
|
||||||
|
|
||||||
|
But, then the implementation of --all changed to not use loggedKeys
|
||||||
|
in [[!commit d010ab04be5a8d74fe85a2fa27a853784d1f9009]].
|
||||||
|
|
||||||
|
I've fixed this!
|
||||||
|
"""]]
|
|
@ -17,8 +17,8 @@ Repositories can be specified using their remote name, their
|
||||||
description, or their UUID. (To undo, use `git-annex semitrust`.)
|
description, or their UUID. (To undo, use `git-annex semitrust`.)
|
||||||
|
|
||||||
When a key is specified, indicates that the content of that key has been
|
When a key is specified, indicates that the content of that key has been
|
||||||
irretrievably lost. This prevents commands like `git annex fsck --all`
|
irretrievably lost. This makes the key be skipped when operating
|
||||||
from complaining about it.
|
on all keys with eg `--all`.
|
||||||
(To undo, add the key's content back to the repository,
|
(To undo, add the key's content back to the repository,
|
||||||
by using eg, `git-annex reinject`.)
|
by using eg, `git-annex reinject`.)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue