From 06f86379b0b9c51f22be41225447ee431793197c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Mar 2021 12:26:10 -0400 Subject: [PATCH] todo from comment --- ...ent_12_4a935c0c8862b24202c877031c35e238._comment | 8 ++++++++ doc/todo/git-annex-unused_--history.mdwn | 13 +++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 doc/git-annex-unused/comment_12_4a935c0c8862b24202c877031c35e238._comment create mode 100644 doc/todo/git-annex-unused_--history.mdwn diff --git a/doc/git-annex-unused/comment_12_4a935c0c8862b24202c877031c35e238._comment b/doc/git-annex-unused/comment_12_4a935c0c8862b24202c877031c35e238._comment new file mode 100644 index 0000000000..339abb4431 --- /dev/null +++ b/doc/git-annex-unused/comment_12_4a935c0c8862b24202c877031c35e238._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 12""" + date="2021-03-11T15:59:50Z" + content=""" +@meribold there is not, but I've opened a todo, +[[todo/git-annex-unused_--history]] +"""]] diff --git a/doc/todo/git-annex-unused_--history.mdwn b/doc/todo/git-annex-unused_--history.mdwn new file mode 100644 index 0000000000..f30aa0de8f --- /dev/null +++ b/doc/todo/git-annex-unused_--history.mdwn @@ -0,0 +1,13 @@ +Add to git-annex unused a --history or similar switch, that makes it look at +the full history of all specified refs, and only consider files unused if +they never appeared in a git commit at all. + +This would, like `git gc`, find files that were added, but then +deleted/changed before being committed. Which git-annex unused already +does, but it also finds files in past versions. If the user wants to keep +past versions, but gc any dangling objects, this would be useful. + +To traverse the whole history and get the list of changes, could use `git +log --raw`. That is reasonably performant but then it needs to feed every +sha into cat-file to find the annex objects, which would probably take a +while. Alternatively perhaps git log --diff and parsing might be faster.