--- /dev/null
+[[!comment format=mdwn
+ username="joey"
+ subject="""Re: Dropping all older versions of a file"""
+ date="2023-08-22T16:23:29Z"
+ content="""
+@mario interesting question..
+
+You could use `git log --raw` to list old versions of the file, and
+then use `git show` to find the git-annex key.
+
+Doable, but would take quite a lot of bother to script.
+I think it would be a good enhancement to git-annex to
+add a [[todo/command_to_list_keys_for_old_versions_of_files]].
+"""]]
--- /dev/null
+A command like `git-annex oldkeys $file` that lists the keys used for all
+previous versions of the file.
+
+It would allow a workflow like eg:
+
+ edit foo
+ git-annex add foo
+ git-annex oldkeys foo | git-annex move --batch-keys --to bar
+
+Or like this:
+
+ git-annex oldkeys foo | git-annex get --batch-keys
+ # proceed to diff between old versions of the file
+ # (although git-annex-diffdriver --get is another way to do this)
+
+Or this to make every old version visible as files:
+
+ n=0
+ for k in $(git-annex oldkeys my.gif); do
+ $n=$(expr $n + 1)
+ ln -s $(git-annex examinkey $k --format='${objectpath}') my.$n.gif
+ done
+
+----
+
+Is oldkeys the best name for this? `git-annex log` is already taken.
+--[[Joey]]