oldkeys: New command that lists the keys used by old versions of a file

The tricky thing about this turned out to be handling renames and reverts.
For that, it has to make two passes over the git log, and to avoid
buffering a possibly huge amount of logs in memory (ie the whole git log of
an entire repository!), runs git log twice.

(It might be possible to speed this up by asking git log to show a diff,
and so avoid needing to use catKey.)

Sponsored-By: Brock Spratlen on Patreon
This commit is contained in:
Joey Hess 2023-08-22 14:51:06 -04:00
parent 6115bced71
commit cf8b30c914
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
8 changed files with 178 additions and 2 deletions

View file

@ -115,6 +115,7 @@ import qualified Command.Direct
import qualified Command.Indirect
import qualified Command.Upgrade
import qualified Command.Forget
import qualified Command.OldKeys
import qualified Command.P2P
import qualified Command.Proxy
import qualified Command.DiffDriver
@ -236,6 +237,7 @@ cmds testoptparser testrunner mkbenchmarkgenerator = map addGitAnnexCommonOption
, Command.Indirect.cmd
, Command.Upgrade.cmd
, Command.Forget.cmd
, Command.OldKeys.cmd
, Command.P2P.cmd
, Command.Proxy.cmd
, Command.DiffDriver.cmd