I've been searching around and can't find this. I don't need git annex unused
, but something that'll list the files I should "git rm".
The best solution I've found so far is:
git annex whereis|grep '0 copies.*failed'|perl -pe 's/^whereis (.*?) \(0 copies\) failed$/$1/'
This works because --copies 1 finds all files with 1 or more copies, and so inverting it with --not finds all files with fewer copies.
Great, this one-liner is then exactly what I needed:
When I first read this:
I expected it would also select files with more than 1 copy. Nothing wrong with it if it works; just seems semantically ambiguous to me.
I've found this useful in combination with this:
Where
NAME
is some remote of "incoming downloads". If nobody's fetched stuff from it let's just "drop" it. Running this before the command Joey suggested is best.Other git-annex comnands than find support the same options for matching files, so you can just use: