chore: ignore extensionless build artifacts at the repo root#61
Merged
Conversation
Compiled example programs (e.g. `chat` from `go build ./internal/examples/chat`) land at the repo root with no extension and were one `git add -A` from being committed — a 15MB binary nearly entered history. The hand-maintained per-name allowlist (/counter, /auth, ...) had drifted and never covered `chat`. Replace it with a general rule: ignore every root-level entry, then re-include directories, any file with an extension, and LICENSE (the only extensionless tracked file). Extensionless root files (build artifacts) are now ignored; a wanted one (e.g. Makefile) needs an explicit !/ line.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiled example programs (e.g.
chatfromgo build ./internal/examples/chat) land at the repo root with no extension, and were onegit add -Afrom entering history — a 15MB binary was sitting untracked at root. The hand-maintained per-name allowlist (/counter,/auth, …) had drifted and never coveredchat.Change
gitignorehas no "no-extension" glob, so the rule ignores every root-level entry, then re-includes directories, any file with an extension, andLICENSE(the only extensionless tracked file). Net effect: extensionless root files (build artifacts) are ignored, everything else is tracked as normal. The drifted per-name allowlist is removed (subsumed).Caveat documented inline: a wanted extensionless root file (e.g.
Makefile) is also ignored and needs an explicit!/Makefileline. Scope is root-only — a binary built insideinternal/examples/X/isn't caught (same scope as the previous allowlist).Verification (
git check-ignore)chat,counter,coverage.out,bin,server,go.work,.claude✓LICENSE,app.go,go.mod,.golangci.yml,.gitignore,ci-check.sh,datastar.js, all source dirs ✓