summaryrefslogtreecommitdiff
path: root/doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-09-13 15:09:37 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-09-13 15:09:37 -0400
commit1e622ebba238639c9f1c34521c1904b17e216f24 (patch)
tree1158001663b7d09641973109a544ef9bf7a248fc /doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn
parent37ff141ff86a4ffd974e17c8cebdf6df9c0e9fd6 (diff)
move wishlist items to todo
Diffstat (limited to 'doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn')
-rw-r--r--doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn37
1 files changed, 37 insertions, 0 deletions
diff --git a/doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn b/doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn
new file mode 100644
index 000000000..7a9b81f72
--- /dev/null
+++ b/doc/todo/wishlist:_option_to_print_more_info_with___39__unused__39__.mdwn
@@ -0,0 +1,37 @@
+It would be nice if the 'unused' command could optionally display info about the actual files behind its cryptic keys.
+
+I created a (very rough) bash script that simply splices in some info from git log -S'KEY' --numstat into the unused list, like so:
+
+ arand@mas:~/annex(master)$ bash ~/utv/scripts/annex-vunused
+ unused . (checking for unused data...) (checking master...) (checking synced/master...) (checking origin/HEAD...) (checking seagate/master...)
+ Some annexed data is no longer used by any files:
+ NUMBER KEY
+ 1 SHA256E-s1073741824--49bc20df15e412a64472421e13fe86ff1c5165e18b2afccf160d4dc19fe68a14.img
+ 8f479a4 Sat Feb 23 16:14:12 2013 +0100 remove bigfile
+ 0 1 dummy_bigfile.img
+ 2988d18 Sat Feb 23 16:13:48 2013 +0100 dummy file
+ 1 0 dummy_bigfile.img
+ (To see where data was previously used, try: git log --stat -S'KEY')To remove unwanted data: git-annex dropunused NUMBER
+ ok
+The script:
+
+ #!/bin/bash
+
+ pipe="$(mktemp -u)"
+ mkfifo "$pipe"
+
+ git annex unused >"$pipe" || exit 1 &
+
+ while read -r line
+ do
+ key="$(echo "$line" | sed 's/^[^-]*-\([^-]*\)-.*/\1/')"
+ echo -n "$line"
+ test -n "$key" && \
+ echo && \
+ git log --format="%h %cd %s" --numstat -S"$key" | \
+ sed '/^$/d;/git-annex automatic sync/,/^ /d;s/^/\t\t/'
+
+ done < "$pipe"
+ rm "$pipe"
+
+It would be nice if something like this was available as an option, since it's good way to get a quick overview of what the content is, and if it's safe to drop it.