Styleguide Makefile stamps an empty version outside a git checkout #74

Open
opened 2026-10-03 14:18:57 +02:00 by clawbot · 1 comment
Collaborator

Item 2 of #72, split out so it can land while the pinning question there waits on the owner.

prompts/CODE_STYLEGUIDE_GO.md and prompts/GO_HTTP_SERVER_CONVENTIONS.md both give VERSION ?= $(shell git describe --tags --always). Outside a git checkout (an unpacked source tarball, for one) git describe prints nothing, so the binary is stamped with an empty version and nothing says so.

Fix

VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev) in both documents, so every repo falls back to dev the same way. Adjust the comment above each line to say so, in one sentence.

This is consistent with the canonical Dockerfile example in prompts/REPO_POLICIES.md, which already fails the build when .git is present but the version comes out empty, dev or unknown: inside a build with .git the fallback never applies, and without .git the build stamps dev. Check that no other canonical text contradicts this (git grep -n 'VERSION' -- prompts/), and fix any that does.

Definition of done

  • Both Makefile examples carry the fallback, with comments that match what the line does.
  • Verified with a scratch Makefile containing exactly the documented line: inside a git checkout it prints the git describe output; in a directory that is not a checkout it prints dev and nothing on stderr; VERSION=x make ... prints x.
  • make check passes.

Model: opus-5-5

Item 2 of https://git.eeqj.de/sneak/prompts/issues/72, split out so it can land while the pinning question there waits on the owner. `prompts/CODE_STYLEGUIDE_GO.md` and `prompts/GO_HTTP_SERVER_CONVENTIONS.md` both give `VERSION ?= $(shell git describe --tags --always)`. Outside a git checkout (an unpacked source tarball, for one) `git describe` prints nothing, so the binary is stamped with an empty version and nothing says so. ## Fix `VERSION ?= $(or $(shell git describe --tags --always 2>/dev/null),dev)` in both documents, so every repo falls back to `dev` the same way. Adjust the comment above each line to say so, in one sentence. This is consistent with the canonical Dockerfile example in `prompts/REPO_POLICIES.md`, which already fails the build when `.git` is present but the version comes out empty, `dev` or `unknown`: inside a build with `.git` the fallback never applies, and without `.git` the build stamps `dev`. Check that no other canonical text contradicts this (`git grep -n 'VERSION' -- prompts/`), and fix any that does. ## Definition of done - Both Makefile examples carry the fallback, with comments that match what the line does. - Verified with a scratch Makefile containing exactly the documented line: inside a git checkout it prints the `git describe` output; in a directory that is not a checkout it prints `dev` and nothing on stderr; `VERSION=x make ...` prints `x`. - `make check` passes. Model: opus-5-5
Author
Collaborator

Done in #84: both Makefile examples now fall back to dev when git describe prints nothing, with the comment above each line saying so. No other canonical text needed a change; the host scripts keep their own unknown fallback, noted as a judgement call on the PR.

Model: opus-5-5

Done in https://git.eeqj.de/sneak/prompts/pulls/84: both Makefile examples now fall back to `dev` when `git describe` prints nothing, with the comment above each line saying so. No other canonical text needed a change; the host scripts keep their own `unknown` fallback, noted as a judgement call on the PR. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/prompts#74