From 8b41f1ebc67a33a3fd6a8cc6c8522bd2a82ece70 Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 19 Jul 2025 13:15:50 -0600 Subject: [PATCH] add a tools directory including a "done-last-week" script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This script lists issues that were marked `Done` between "midnight at the start of the second most recent Monday" and "midnight at the start of the most recent Monday". $ ./tools/done-last-week Done: 8c73c9fd5bc4f551ee5069035ae6e866 migrate the Todo list into entomologist 75cefad80aacbf23fc7b9c24a75aa236 🗨️ 4 # implement `ent comment ISSUE [DESCRIPTION]` (👉 seb) 7da3bd5b72de0a05936b094db5d24304 🗨️ 1 implement `ent edit ${COMMENT}` (👉 seb) 198a7d56a19f0579fbc04f2ee9cc234f fix ignoring unknown file in issues directory: "README.md" e089400e8a9e11fe9bf10d50b2f889d7 add `ent sync` to keep local `entomologist-data` branch in sync with remote a26da230276d317e85f9fcca41c19d2e `ent edit ${ISSUE}` with no change fails (👉 seb) 317ea8ccac1d414cde55771321bdec30 🗨️ 2 allow multiple read-only ent processes simultaneously (👉 seb) da435e5e298b28dc223f9dcfe62a9140 add user control over state transitions (👉 lex) fd81241f795333b64e7911cfb1b57c8f commit messages in the `entomologist-data` branch could be better (👉 seb) 093e87e8049b93bfa2d8fcd544cae75f add optional 'assignee' to issue (👉 seb) 793bda8b9726b0336d97e856895907f8 `ent list` should have a consistent sort order (👉 seb) af53c561b36e9b2709b939f81daee534 use git author info to attribute issues and comments to people (👉 seb) 9e69a30ad6965d7488514584c97ac63c teach `ent list FILTER` to filter by assignee (👉 seb) a5ac277614ea4d13f78031abb25ea7d6 `ent new` and `ent comment`: detect empty issue descriptions & comments (👉 seb) 7d2d236668872cf11f167ac0462f8751 🗨️ 1 add `ent tag ISSUE [[-]TAG]` (👉 seb) 54f0eb67b05aa10763c86869ce840f33 `ent sync` should report what changes got fetched & what changes will be pushed (👉 seb) 4e314a8590864fa76d22758e1785ae35 don't spawn an editor if stdin & stdout aren't a terminal (👉 seb) d3a705245bd69aa56524b80b5ae0bc26 🗨️ 1 move IssuesDatabase out of binary and into library (👉 sigil-03) --- tools/README.md | 4 ++++ tools/done-last-week | 11 +++++++++++ tools/set-done-time | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 tools/README.md create mode 100755 tools/done-last-week create mode 100755 tools/set-done-time diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..dd3cb2f --- /dev/null +++ b/tools/README.md @@ -0,0 +1,4 @@ +This directory contains small helper scripts and tools that are peripheral +or tangent to the main entomologist tool. + +We make no guarantees about functionality or correctness. diff --git a/tools/done-last-week b/tools/done-last-week new file mode 100755 index 0000000..da9ec94 --- /dev/null +++ b/tools/done-last-week @@ -0,0 +1,11 @@ +#!/bin/bash + +START=$(date --iso-8601=seconds --date='last monday - 1 week') +END=$(date --iso-8601=seconds --date='last monday') + +#echo START=${START} +#echo END=${END} + +ent list \ + state=done \ + done-time="${START}..${END}" diff --git a/tools/set-done-time b/tools/set-done-time new file mode 100755 index 0000000..6a29fd9 --- /dev/null +++ b/tools/set-done-time @@ -0,0 +1,19 @@ +#!/bin/bash +# +# This script finds all issues with state=Done which do not have a +# `done_time`. +# +# It sets each issue's `done_time` to the most recent time that the +# `state` was updated from the git log. +# + +set -e + +for ISSUE_ID in $(ent list state=done done-time=9999-01-01T00:00:00-06:00.. | grep ' ' | cut -f 1 -d ' '); do + echo ${ISSUE_ID} + UTIME=$(PAGER='' git log -n1 --pretty=format:%at%n entomologist-data -- ${ISSUE_ID}/state) + echo ${UTIME} + DATETIME=$(date --rfc-3339=seconds --date="@${UTIME}") + echo ${DATETIME} + ent done-time ${ISSUE_ID} "${DATETIME}" +done -- 2.47.3