diff --git a/doc/forum/Best_way_to_remove_old_version_of_specific_file/comment_6_e854d6b778bcb7dc1578cbc9c8fcaa42._comment b/doc/forum/Best_way_to_remove_old_version_of_specific_file/comment_6_e854d6b778bcb7dc1578cbc9c8fcaa42._comment new file mode 100644 index 0000000000..0c315fa13f --- /dev/null +++ b/doc/forum/Best_way_to_remove_old_version_of_specific_file/comment_6_e854d6b778bcb7dc1578cbc9c8fcaa42._comment @@ -0,0 +1,14 @@ +[[!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]]. +"""]] diff --git a/doc/todo/command_to_list_keys_for_old_versions_of_files.mdwn b/doc/todo/command_to_list_keys_for_old_versions_of_files.mdwn new file mode 100644 index 0000000000..8e0bf89e61 --- /dev/null +++ b/doc/todo/command_to_list_keys_for_old_versions_of_files.mdwn @@ -0,0 +1,27 @@ +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]]