From: Michal Sojka Date: Fri, 27 Jul 2018 11:54:31 +0000 (+0200) Subject: Show correct information even after removing a home directory X-Git-Tag: debian/20180727~1 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/duhome.git/commitdiff_plain/e6089bf18f9823a3045e66d2fee61d79ea078fc3?hp=c487b96595e05dbe69377d1c95af406d10e0094a Show correct information even after removing a home directory Now, save removes all the old data and recreates them according to the current state. Status shows the data last commited, not the data from the work tree, which might be deleted due to `save` running in parallel. --- diff --git a/duhome b/duhome index 15896fe..09e8ff3 100755 --- a/duhome +++ b/duhome @@ -12,6 +12,7 @@ case "$1" in ;; save) cd $DATA + git rm '*' # Remove old data - perhaps, some homes were removed for i in /home/*; do du -shx $i | cut -f1 > ${i#/home/}; git add ${i#/home/} @@ -26,6 +27,9 @@ case "$1" in status) cd $DATA grep . *|sort -h -k2 -t: + git ls-files --with-tree=HEAD | while read f; do + echo "$f:$(git show "HEAD:$f")" + done | sort -h -k2 -t: ;; log) cd $DATA