summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-12-13 10:50:19 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-12-13 10:50:29 -0700
commit64b9b82edff582d3ab1739a4b2b87ffdb2d80dad (patch)
tree22a770af7c35f1c1dcd2d2ef4dcea0cdb44bc09c /lib-src
parent46d4585c9671ee153e997c8f94c205390603c06b (diff)
downloaddotfiles-64b9b82edff582d3ab1739a4b2b87ffdb2d80dad.tar.gz
implement dropping old versions of score files from src/athpriv
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/mr/config12
1 files changed, 10 insertions, 2 deletions
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]