BrighterCommand / BrighterCommand/Brighter
bugfixes/.current-bug is tracked shared state that every bugfix branch rewrites
- Dominant language
- C#
- Stars
- 2.5k
- Forks
- 296
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
## Summary
`bugfixes/.current-bug` is a tracked file holding a single line naming the active bugfix. It is
per-developer, per-session state, but it lives in version control, so **every bugfix branch rewrites the
same one-line file**. That makes it a guaranteed conflict point between concurrent branches, and it
silently loses history when branches merge in the wrong order.
## Evidence that the collision is real, not theoretical
- Working on #4310 this session, switching from the conformance branch to the fix branch failed outright:
```
error: Your local changes to the following files would be overwritten by checkout:
bugfixes/.current-bug
Please commit your changes or stash them before you switch branches.
Aborting
```
The only way through was to discard the file. Nothing about the two branches genuinely conflicted —
the collision was entirely in this bookkeeping file.
- The sequence has already lost an entry. `bugfixes/` on `master` runs `0001`..`0017`, and the value
most recently committed was `0016`. `0018-asb-subscription-created-after-send` (for #4309) exists as
work in progress but has no home on any merged branch, because whichever branch carries it will
rewrite `.current-bug` and conflict with whatever else touched it.
## Why the file is different from the rest of `bugfixes/`
The `bugfix.md` documents, `.issue-number` and `.confirm-approved` markers are all **per-bug** and
belong in the branch that fixes that bug — they are a genuine artefact of the work and are useful in
review. `.current-bug` is the odd one out: it is **global mutable state** describing which bug a
particular working copy is pointed at right now, which is not a property of the branch at all.
## Suggested fix
Add `bugfixes/.current-bug` to `.gitignore` and `git rm --cached` it. The `/bugfix:*` skills read and
write it locally exactly as they do now; nothing about the workflow changes except that it stops being
shared. `/bugfix:switch` and `/bugfix:status` already reconstruct the picture from the directories
themselves, so no information is lost.
If a committed record of which bug a branch addresses is wanted, the per-bug `.issue-number` file
already provides it, and it does not collide.
Noticed while responding to review feedback on #4311.
Contributor guide
Assessment
This issue has not been assessed yet.