From 64b9b82edff582d3ab1739a4b2b87ffdb2d80dad Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 13 Dec 2022 10:50:19 -0700 Subject: implement dropping old versions of score files from src/athpriv --- lib-src/mr/config | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib-src') diff --git a/lib-src/mr/config b/lib-src/mr/config index cb33e1ad..e625db77 100644 --- a/lib-src/mr/config +++ b/lib-src/mr/config @@ -161,12 +161,20 @@ post_checkout = on athena || git remote add athenah athenah:src/athpriv git annex group . backup -# TODO Use git-annex-whereused to systematically drop old News/*. - autoci = git annex add News/* git commit News -m"auto commit of Gnus score files" ||: +fixups = + # Drop score files unused by master or origin/master for a week. + # We keep an additional backup of most of all.SCORE committed to ~/doc/. + [ "$MR_ACTION" = checkout -o "$MR_ACTION" = update ] || git fetch origin + git annex unused \ + --used-refspec="+refs/heads/master:+refs/remotes/origin/master" \ + | perl -wlne'BEGIN { $w = time - 7*24*60*60 } /^\s+(\d+)\s+/ + and $t = `git log -1 --format="%ct" --no-textconv -S"$'"'"'" -- News` + and $t < $w and print $1' | xargs git annex dropunused --force + #################################################################### [doc] -- cgit v1.2.3