]> dgit.raspbian.org Git - git-annex.git/commitdiff
comment
authorJoey Hess <joeyh@joeyh.name>
Mon, 19 Jul 2021 16:39:17 +0000 (12:39 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 19 Jul 2021 16:39:17 +0000 (12:39 -0400)
doc/forum/Drop__47__move_unused_files_older_than_x/comment_1_626facc640a9018a04f203d10aff7676._comment [new file with mode: 0644]

diff --git a/doc/forum/Drop__47__move_unused_files_older_than_x/comment_1_626facc640a9018a04f203d10aff7676._comment b/doc/forum/Drop__47__move_unused_files_older_than_x/comment_1_626facc640a9018a04f203d10aff7676._comment
new file mode 100644 (file)
index 0000000..684300e
--- /dev/null
@@ -0,0 +1,22 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2021-07-19T15:43:46Z"
+ content="""
+There's a new command, added just last week, that gets close to this. 
+`git annex whereused --unused --historical` will display each unused
+key, along with a git rev where that key was found to be used.
+
+The git rev looks like eg "master~4:filename" or "HEAD@{40}:filename".
+It will usually be the most recent use, although it prefers older uses
+that made it into a branch over any revs from the reflog.
+
+Seems like perhaps `git rev-list --no-walk --before=` could be used in a shell
+pipeline with whereused. I suppose it would be a kind of ugly pipeline,
+since it would have to extract the rev, strip the filename from it, pass
+it through git rev-list, and then output the key when rev-list output a
+rev.
+
+Or, the same method that whereused uses to find where keys were used
+could be applied in something like `git annex unused --older-than=1day`.
+"""]]