A plain docker build . of a clone now stamps the commit into the binary, for #7. attrsum had no version; it now has --version.
attrsum.go: a Version string (default dev), set at link time with -X and printed by cobra's built-in --version. -v stays verbose.
Makefile: make build stamps git describe --tags --always --dirty, or dev without git; make build VERSION=x stamps x.
Dockerfile: the compiling stage takes the VERSION build argument when given, otherwise git describe --tags --always on the .git in the context, and fails if .git is present and the result is empty, dev or unknown. Without .git it stamps dev.
.dockerignore: new, the canonical copy from sneak/promptsnext; it sends .git but not .git/config, which can hold a credential. Below the shared part, this repo's own /attrsum (the host-built binary .gitignore already lists), so a host build never enters the image.
.gitea/workflows/check.yml: the checkout step fetches full history (fetch-depth: 0), so CI sees the 1.0.0 tag and stamps the same 1.0.0-N-gHASH as a full clone.
script/docker: replaced with the canonical copy, since it says it is identical in all repos. It now builds with --no-cache and passes the host's version as VERSION.
Worth knowing: script/cibuild is unchanged; it is not the shared copy, and its plain docker build . now finds the version itself.
Judgement call: no unit test; the linker sets the value and cobra prints it.
Model: opus-5-5
A plain `docker build .` of a clone now stamps the commit into the binary, for https://git.eeqj.de/sneak/attrsum/issues/7. attrsum had no version; it now has `--version`.
- `attrsum.go`: a `Version` string (default `dev`), set at link time with `-X` and printed by cobra's built-in `--version`. `-v` stays verbose.
- `Makefile`: `make build` stamps `git describe --tags --always --dirty`, or `dev` without git; `make build VERSION=x` stamps `x`.
- `Dockerfile`: the compiling stage takes the `VERSION` build argument when given, otherwise `git describe --tags --always` on the `.git` in the context, and fails if `.git` is present and the result is empty, `dev` or `unknown`. Without `.git` it stamps `dev`.
- `.dockerignore`: new, the canonical copy from `sneak/prompts` `next`; it sends `.git` but not `.git/config`, which can hold a credential. Below the shared part, this repo's own `/attrsum` (the host-built binary `.gitignore` already lists), so a host build never enters the image.
- `.gitea/workflows/check.yml`: the checkout step fetches full history (`fetch-depth: 0`), so CI sees the `1.0.0` tag and stamps the same `1.0.0-N-gHASH` as a full clone.
- `script/docker`: replaced with the canonical copy, since it says it is identical in all repos. It now builds with `--no-cache` and passes the host's version as `VERSION`.
Worth knowing: `script/cibuild` is unchanged; it is not the shared copy, and its plain `docker build .` now finds the version itself.
Judgement call: no unit test; the linker sets the value and cobra prints it.
Model: opus-5-5
attrsum --version now prints the git tag or short commit. make build
stamps it with -X from git describe, and the Dockerfile takes the VERSION
build argument when given, otherwise git describe --tags --always on the
.git in the build context, failing if .git is present and no version
comes out. A new .dockerignore, the canonical one, keeps .git/config out
of the context, and also this repo's host-built /attrsum. CI checks out
full history so it sees the 1.0.0 tag and stamps what a full clone does.
script/docker is replaced with the canonical copy.
Model: opus-5-5
TODO.md line 47: the Future Steps item "Add Dockerfile and .dockerignore that run make check, images pinned by sha256, plus a Makefile docker target" is now done (the Dockerfile and make docker already exist; this PR adds .dockerignore), yet it stays under Future Steps next to the new Completed Steps entry that records the .dockerignore, so the file contradicts itself. Remove that item in the same commit, as the file's own Workflow section says.
Dockerfile line 43: the build reports "no version could be derived" also when a VERSION build argument of dev or unknown was given and rejected (for example unknown from script/docker when git fails on the host), which sends the reader to debug git inside the build instead of the argument. Name the rejected value in the message, as the example in prompts/REPO_POLICIES.md on sneak/promptsnext does (version is '$VERSION' although .git is present).
Model: opus-5-5
- `TODO.md` line 47: the Future Steps item "Add Dockerfile and .dockerignore that run make check, images pinned by sha256, plus a Makefile docker target" is now done (the `Dockerfile` and `make docker` already exist; this PR adds `.dockerignore`), yet it stays under Future Steps next to the new Completed Steps entry that records the `.dockerignore`, so the file contradicts itself. Remove that item in the same commit, as the file's own Workflow section says.
- `Dockerfile` line 43: the build reports "no version could be derived" also when a `VERSION` build argument of `dev` or `unknown` was given and rejected (for example `unknown` from `script/docker` when git fails on the host), which sends the reader to debug git inside the build instead of the argument. Name the rejected value in the message, as the example in `prompts/REPO_POLICIES.md` on `sneak/prompts` `next` does (`version is '$VERSION' although .git is present`).
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
A plain
docker build .of a clone now stamps the commit into the binary, for #7. attrsum had no version; it now has--version.attrsum.go: aVersionstring (defaultdev), set at link time with-Xand printed by cobra's built-in--version.-vstays verbose.Makefile:make buildstampsgit describe --tags --always --dirty, ordevwithout git;make build VERSION=xstampsx.Dockerfile: the compiling stage takes theVERSIONbuild argument when given, otherwisegit describe --tags --alwayson the.gitin the context, and fails if.gitis present and the result is empty,devorunknown. Without.gitit stampsdev..dockerignore: new, the canonical copy fromsneak/promptsnext; it sends.gitbut not.git/config, which can hold a credential. Below the shared part, this repo's own/attrsum(the host-built binary.gitignorealready lists), so a host build never enters the image..gitea/workflows/check.yml: the checkout step fetches full history (fetch-depth: 0), so CI sees the1.0.0tag and stamps the same1.0.0-N-gHASHas a full clone.script/docker: replaced with the canonical copy, since it says it is identical in all repos. It now builds with--no-cacheand passes the host's version asVERSION.Worth knowing:
script/cibuildis unchanged; it is not the shared copy, and its plaindocker build .now finds the version itself.Judgement call: no unit test; the linker sets the value and cobra prints it.
Model: opus-5-5
c6497c2ccdto876b621f2fTODO.mdline 47: the Future Steps item "Add Dockerfile and .dockerignore that run make check, images pinned by sha256, plus a Makefile docker target" is now done (theDockerfileandmake dockeralready exist; this PR adds.dockerignore), yet it stays under Future Steps next to the new Completed Steps entry that records the.dockerignore, so the file contradicts itself. Remove that item in the same commit, as the file's own Workflow section says.Dockerfileline 43: the build reports "no version could be derived" also when aVERSIONbuild argument ofdevorunknownwas given and rejected (for exampleunknownfromscript/dockerwhen git fails on the host), which sends the reader to debug git inside the build instead of the argument. Name the rejected value in the message, as the example inprompts/REPO_POLICIES.mdonsneak/promptsnextdoes (version is '$VERSION' although .git is present).Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.