Readable Git Annex Unused
So unless you know and use git annex, this is not going to be very useful for you. Check it out, though. It's pretty cool. Unless you are on Windows. In that case it's hell. Anyway, I wrote a script to help me figure out the output of git annex unused. In short, it tells you what those files used to be called before you lost them. Script:
import re, sys, os
from subprocess import Popen,PIPE
FNULL = open(os.devnull, 'w')
process = Popen(["git", "log", "--stat", "-S", s], stderr=FNULL, stdout=PIPE)
log = process.stdout.read().decode("utf-8")
match = re.search(r"(([ -~]*\/)*[ -~]*)\|", log)
if not match: return ''
else: return match.group(1).strip()
print( seeker(sys.argv) )
clist = 
crawl = input().strip()
if not crawl: break
crawl = crawl.split()
for x in clist:
print('%s : %s' % ( x, seeker(x) ) )
You can either call it with one argument which should be a key, or if you call it with no argument, it expects you to paste the list of results you got from git annex unused into stdin. It then goes through the list and tells you the corresponding filename for each key.
This script is phenomenally stupid in that it does quite a terrible regular expression search on the output of git log and returns the first match it finds. Sue me, it works pretty well at my end.