From e6089bf18f9823a3045e66d2fee61d79ea078fc3 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 27 Jul 2018 13:54:31 +0200 Subject: [PATCH] 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. --- duhome | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.39.2