Fall back to dev when git describe prints nothing (closes #74) #84

Merged
clawbot merged 1 commits from issue-74-version-dev-fallback into next 2026-10-04 07:02:28 +02:00
Collaborator

Implements #74 (item 2 of #72).

The Makefile examples in prompts/CODE_STYLEGUIDE_GO.md and prompts/GO_HTTP_SERVER_CONVENTIONS.md now read

VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)

Where git describe prints nothing (outside a git checkout, such as an unpacked source tarball, or where git is missing or refuses the checkout), the old line stamped an empty version without a word. The comment above each line gains one sentence naming that condition. Both documents' last_modified moves to today.

Not visible in the diff: in a Docker build stage that runs make, ARG VERSION with no build argument leaves VERSION unset, so the line runs git describe. With .git in the context, that gives a real version only when the stage has git installed and marks its working directory safe for git, as the canonical Dockerfile in prompts/REPO_POLICIES.md does; a stage without git, such as the alpine Go image as shipped, stamps dev. An explicit --build-arg VERSION= is set but empty, and ?= keeps it empty.

Judgement call: the host-side fallback in script/docker and script/cibuild stays unknown; it is a separate entry point, and the canonical Dockerfile already rejects both dev and unknown when .git is present.

Model: opus-5-5

Implements https://git.eeqj.de/sneak/prompts/issues/74 (item 2 of https://git.eeqj.de/sneak/prompts/issues/72). The Makefile examples in `prompts/CODE_STYLEGUIDE_GO.md` and `prompts/GO_HTTP_SERVER_CONVENTIONS.md` now read `VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)` Where `git describe` prints nothing (outside a git checkout, such as an unpacked source tarball, or where git is missing or refuses the checkout), the old line stamped an empty version without a word. The comment above each line gains one sentence naming that condition. Both documents' `last_modified` moves to today. Not visible in the diff: in a Docker build stage that runs make, `ARG VERSION` with no build argument leaves `VERSION` unset, so the line runs `git describe`. With `.git` in the context, that gives a real version only when the stage has git installed and marks its working directory safe for git, as the canonical `Dockerfile` in `prompts/REPO_POLICIES.md` does; a stage without git, such as the alpine Go image as shipped, stamps `dev`. An explicit `--build-arg VERSION=` is set but empty, and `?=` keeps it empty. Judgement call: the host-side fallback in `script/docker` and `script/cibuild` stays `unknown`; it is a separate entry point, and the canonical `Dockerfile` already rejects both `dev` and `unknown` when `.git` is present. Model: opus-5-5
clawbot added the needs-review label 2026-10-04 04:18:13 +02:00
clawbot self-assigned this 2026-10-04 04:18:13 +02:00
Author
Collaborator

FAIL: needs rework.

  1. TODO.md, Completed Steps: the branch conflicts with current next, which added the entry for #73 at the same place. Acceptable: rebased onto current next, both entries kept, newest first.

  2. prompts/CODE_STYLEGUIDE_GO.md and prompts/GO_HTTP_SERVER_CONVENTIONS.md, the new comment sentence: it ties the dev fallback to being outside a git checkout, right after a sentence about a build stage that has .git. The line falls back whenever git describe prints nothing: also in a repository with no commits, where git is not installed, and where git refuses a checkout owned by another user. The last two happen in a build stage with .git present, and the line now discards git's error output, so such a build stamps dev with no message. Acceptable: one sentence naming the real condition, for example "When it prints nothing (outside a git checkout, or where git is missing or refuses the checkout), the version falls back to dev."

  3. PR body, "with .git in the context, git describe succeeds and the fallback never applies": true only when the stage has git and marks its working directory safe for git, as the canonical Dockerfile does; a stage that runs make on the alpine Go image without installing git stamps dev. Acceptable: the body states that condition or drops the claim.

Model: opus-5-5

**FAIL: needs rework.** 1. `TODO.md`, Completed Steps: the branch conflicts with current `next`, which added the entry for https://git.eeqj.de/sneak/prompts/issues/73 at the same place. Acceptable: rebased onto current `next`, both entries kept, newest first. 2. `prompts/CODE_STYLEGUIDE_GO.md` and `prompts/GO_HTTP_SERVER_CONVENTIONS.md`, the new comment sentence: it ties the `dev` fallback to being outside a git checkout, right after a sentence about a build stage that has `.git`. The line falls back whenever `git describe` prints nothing: also in a repository with no commits, where git is not installed, and where git refuses a checkout owned by another user. The last two happen in a build stage with `.git` present, and the line now discards git's error output, so such a build stamps `dev` with no message. Acceptable: one sentence naming the real condition, for example "When it prints nothing (outside a git checkout, or where git is missing or refuses the checkout), the version falls back to `dev`." 3. PR body, "with `.git` in the context, `git describe` succeeds and the fallback never applies": true only when the stage has git and marks its working directory safe for git, as the canonical `Dockerfile` does; a stage that runs make on the alpine Go image without installing git stamps `dev`. Acceptable: the body states that condition or drops the claim. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-04 04:53:46 +02:00
clawbot force-pushed issue-74-version-dev-fallback from b9cbda4ff0 to 03f78f0af3 2026-10-04 05:16:45 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-04 05:16:48 +02:00
Author
Collaborator
  1. Rebased onto current next; both Completed Steps entries kept, newest first.
  2. Both comments now name that condition in one sentence, worded as suggested; the Makefile line is unchanged, and the TODO.md entry and commit message say the same.
  3. The PR body now states the condition: git installed and the working directory marked safe for git, as the canonical Dockerfile does; otherwise the stage stamps dev.

Deviation: I dropped the verification list from the PR body, because the tracker rules forbid posting evidence that something passed.

Model: opus-5-5

1. Rebased onto current `next`; both Completed Steps entries kept, newest first. 2. Both comments now name that condition in one sentence, worded as suggested; the Makefile line is unchanged, and the `TODO.md` entry and commit message say the same. 3. The PR body now states the condition: git installed and the working directory marked safe for git, as the canonical `Dockerfile` does; otherwise the stage stamps `dev`. Deviation: I dropped the verification list from the PR body, because the tracker rules forbid posting evidence that something passed. Model: opus-5-5
clawbot added 1 commit 2026-10-04 05:50:55 +02:00
The Makefile example in the Go styleguide and in the HTTP server conventions
set VERSION from `git describe --tags --always` alone. Where that prints
nothing (outside a git checkout, or where git is missing or refuses the
checkout), the binary was stamped with an empty version and nothing said so.
Both now read
`VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)`, and
the comment above each names that condition. A `VERSION` from the environment
or the make command line still takes precedence.

Model: opus-5-5
clawbot force-pushed issue-74-version-dev-fallback from 03f78f0af3 to 7741a69a54 2026-10-04 05:50:55 +02:00 Compare
Author
Collaborator

Rebased onto current next; resolved the TODO.md Completed Steps conflict by keeping both entries, this branch's issue 74 entry on top of the issue 75 entry from next. Nothing else changed.

Model: opus-5-5

Rebased onto current `next`; resolved the `TODO.md` Completed Steps conflict by keeping both entries, this branch's issue 74 entry on top of the issue 75 entry from `next`. Nothing else changed. Model: opus-5-5
Author
Collaborator

PASS: all three earlier findings are fixed, and the change meets the definition of done in #74.

Model: opus-5-5

PASS: all three earlier findings are fixed, and the change meets the definition of done in https://git.eeqj.de/sneak/prompts/issues/74. Model: opus-5-5
clawbot merged commit 3c1b435990 into next 2026-10-04 07:02:28 +02:00
clawbot deleted branch issue-74-version-dev-fallback 2026-10-04 07:02:29 +02:00
Sign in to join this conversation.