Skip to content

fix(make): mark the commit -dirty for uncommitted changes - #18

Merged
boeboe merged 1 commit into
mainfrom
fix/make-dirty-commit
Nov 8, 2026
Merged

boeboe merged 1 commit into
mainfrom
fix/make-dirty-commit

Conversation

@boeboe

@boeboe boeboe commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

make build injected the bare HEAD SHA as the commit, so a binary built from a tree with uncommitted changes reported a clean-looking commit, while a plain go build marks it -dirty.

The Makefile now appends -dirty using the same test Go uses for vcs.modified (git status --porcelain, so untracked files count too). Outside a git checkout the suffix is empty.

  • Release builds are unchanged: the release workflow sets COMMIT itself.
  • Checked: COMMIT ends in -dirty with changes, is the plain SHA on a clean tree, and gets -dirty from an untracked file alone. A real make build (knxctl) printed commit 20d9f95… from a clean tree and commit 20d9f95…-dirty after an edit.

🤖 Generated with Claude Code

make build injected the bare HEAD SHA, so a build from a tree with
changes reported a clean-looking commit, while go build marks it
-dirty. The Makefile now appends -dirty on the same test Go uses for
vcs.modified (git status --porcelain). Release builds are unchanged:
the release workflow sets COMMIT itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@boeboe
boeboe merged commit 957061d into main Nov 8, 2026
23 checks passed
@boeboe
boeboe deleted the fix/make-dirty-commit branch November 8, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant