Check-in by ben on 2025-11-12 15:39:33
Quit if no new commits exist since last time coprolit.awk was
run.
INSERTED DELETED
14 0 coprolit.awk
14 0 TOTAL over 1 changed file
Index: coprolit.awk
==================================================================
--- coprolit.awk
+++ coprolit.awk
@@ -833,10 +833,11 @@
} else {
_timeline_opt = ""
}
_download_count = 0
+ quit_if_uptodate(_work)
fossil_configuration(_conf)
if (length(_conf["project-name"]) == 0) {
print "Error: Could not find fossil project name"
exit 1
}
@@ -925,10 +926,23 @@
line++
}
println(out, " " buf)
return
}
+
+function quit_if_uptodate(workdir, cmd, path) {
+ cmd = "fossil timeline -n 1 --oneline -R " _repo
+ if ((cmd | getline) > 0) {
+ path = workdir "/info/" $1
+ if (exists(path "/gophermap") || exists(path "/index.gph")) {
+ printf "Directory %s up-to-date, quitting early...\n", _work
+ exit 0
+ }
+ }
+ close(cmd)
+ return
+}
function reference(out, refs, i) {
info(out, "")
info(out, "# Reference")
info(out, "")