Fall back to dev when git describe prints nothing (closes #74)
check / check (push) Successful in 35s

The Makefile example in the Go styleguide and in the HTTP server conventions
set VERSION from `git describe --tags --always` alone. Outside a git checkout,
such as an unpacked source tarball, that prints nothing, so 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 says so. A `VERSION` from the environment or the make
command line still takes precedence.

Model: opus-5-5
This commit is contained in:
2026-10-04 02:16:59 +00:00
parent 343628fb3a
commit b9cbda4ff0
3 changed files with 13 additions and 6 deletions
+5
View File
@@ -21,6 +21,11 @@ fmt-check, and commit.
# Completed Steps
- 2026-10-04: The Makefile examples in the Go styleguide and the HTTP server
conventions now fall back to `dev` when `git describe` prints nothing, as it
does outside a git checkout, instead of stamping an empty version (issue 74).
The canonical `Dockerfile` already fails on a `dev` version when `.git` is in
the build context.
- 2026-10-03: Moved the canonical golangci-lint to v2.14.0, built with go1.27,
because v2.12.2 refuses to lint a module whose `go` directive is 1.27 (issue
65). Releases from v2.13.0 deprecate `exhaustruct` in favour of