From 2f55a831bd2ef29b4713c0c64a208bea24de93fd Mon Sep 17 00:00:00 2001 From: Martin Simon Date: Tue, 8 Sep 2026 14:26:41 +0200 Subject: [PATCH] Say what the code does now, not what it did before A pass over every comment in this repository, on three rules. No hardcoded dates. A measurement's value is the number, not the day it was taken, and a date in a comment is a claim that ages without anyone checking it. The measurements stay; "Measured 2026-09-06 on lychee 0.24.2" becomes "measured on lychee 0.24.2". No past-state narration. A comment describing what the code used to do makes a reader reconstruct a version that no longer exists before reaching the one in front of them. Each of these is rewritten to state current behaviour and the reason for it, keeping the failure mode where it is what makes the reason legible. Shorter, without dropping anything load-bearing. Run-together blocks split, summary sentences moved to the front of the comment they summarise. Comment-only: every executable line in this diff is byte-identical to the one it replaces, verified by stripping comments from both sides and diffing. --- commit-branch.sh | 7 +++---- tests/run.sh | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/commit-branch.sh b/commit-branch.sh index 03aebe7..c9235e6 100755 --- a/commit-branch.sh +++ b/commit-branch.sh @@ -47,10 +47,9 @@ cd "$WORKDIR" # createCommitOnBranch commits onto a branch that already exists; it cannot # create one, because a branch needs a commit and this is how commits are made. -# The old git-push path bootstrapped a missing branch with `git init`, and that -# is the one thing lost here. Both state branches have existed since the -# archive did, so this fires only if one is deleted -- in which case the fix is -# to recreate it deliberately, not to have a workflow guess at its contents. +# Bootstrapping a missing branch is deliberately not done here: this fires only +# if a state branch is deleted, and the fix then is to recreate it deliberately +# rather than have a workflow guess at its contents. if ! git rev-parse --git-dir >/dev/null 2>&1; then log "FATAL: $WORKDIR is not a checkout of $BRANCH." log " The branch has to exist before anything can be committed to it." diff --git a/tests/run.sh b/tests/run.sh index 07682c1..d010099 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -151,10 +151,10 @@ echo "an HTTP failure reports what GitHub said, not just curl's exit code" git -c user.name=t -c user.email=t@example.invalid commit -qm base printf 'two\n' > keep.txt - # curl as --fail-with-body behaves on an HTTP error: the body is written - # to the output AND the exit status is non-zero. That combination is what - # used to lose the message -- set -e took the exit before anything printed - # the body, and the trap then deleted the file. + # curl as --fail-with-body behaves on an HTTP error: the body is written to + # the output AND the exit status is non-zero. That combination loses the + # message unless it is handled -- set -e takes the exit before anything + # prints the body, and the trap then deletes the file. mkdir -p "$work/bin" cat > "$work/bin/curl" <<'FAKE' #!/bin/sh