chore: stop ignoring the tracked Cargo.lock - #76
Conversation
`.gitignore` line 8 listed `Cargo.lock`, but `Cargo.lock` has been tracked in this repo all along (`git ls-files --error-unmatch Cargo.lock` succeeds). The pattern therefore never took effect for the committed file -- git exempts files already in the index -- it only sat there as a false statement about the repo's intent, and would silently swallow the lockfile for anyone who removed and re-added it. Committing the lockfile is the right call for this workspace: the publish workflow builds release wheels for seven platform targets (manylinux x86_64/aarch64, musllinux x86_64/aarch64, windows x64, macOS x86_64/aarch64) from the same Rust sources, and a pinned dependency graph is what makes those builds reproducible and comparable. So the fix is to drop the ignore line, not to untrack the file. Deleting the line surfaces no new untracked files -- `git status` is clean afterwards -- because the only `Cargo.lock` in the tree is the tracked one at the workspace root. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The conflict with #72 you flagged is already resolved — no action needed here. I force-pushed a rebuild of #72 against current Verified just now: So this PR is a clean one-line deletion against Thanks for catching it — and for the better diagnostic. |
.gitignoreline 8 listedCargo.lock, butCargo.lockis — and always has been — tracked in this repo. The pattern was never in effect for the committed file, so this is a one-line correction of a.gitignorethat stated the opposite of the repo's actual (and correct) policy.Why keep the lockfile tracked rather than untrack it
Both halves of the contradiction could be resolved by deleting the file instead. That would be the wrong call here:
publish.yamlbuilds release wheels for seven platform targets from the same Rust sources —x86_64,aarch64x86_64,aarch64x64x86_64(macos-13),aarch64(macos-14)A pinned dependency graph is what makes those seven builds reproducible and comparable to each other, and what makes a release bisectable later.
Cargo.lockbelongs in the tree; the ignore line does not.Why the stale line was not harmless
Git exempts files already in the index from
.gitignore, which is why nothing visibly broke. Two real costs:.gitignoreconcludes the lockfile is deliberately untracked.git rm --cached Cargo.lock(or re-adds the file in a fresh clone path), the lockfile silently disappears from the repo with nogit statusentry to notice.Verification
Chore bucket — no behaviour change, so there is no failing→passing example to show. What there is to verify is the contradiction itself and that removing the line surfaces nothing new. Verbatim, in a clean worktree off
origin/v2.0(542c3c2):Before — the file is tracked and the repo claims to ignore it:
Note
--no-index: plaingit check-ignore Cargo.lockexits 1 and prints nothing, because git skips the ignore rules for tracked files. That exemption is exactly what hid this for so long, so--no-indexis the flag that actually shows what the pattern says.The general form of the check, which finds every tracked-but-ignored path at once:
(
.claude/settings.local.jsonis not a repo-level contradiction — it is matched by my personal global~/.config/git/ignore, not by anything in this repo. Mentioned only so the output above is not misread.)After — file still tracked, no rule claims it, nothing new appears:
The working tree stays clean because the only
Cargo.lockin the tree is the tracked one at the workspace root —find . -name Cargo.lock -not -path './.git/*'returns just./Cargo.lock, even though the workspace has two members (daisy-core,daisy-py), neither of which carries its own lockfile.Diff
*.egg-info/ -Cargo.lock # Sphinx build artifactsHeads-up: trivial conflict with #72
#72 adds
.vscodeimmediately after theCargo.lockline, so its hunk and this deletion overlap. Confirmed, not guessed:Whichever lands second needs a one-line resolution: keep
.vscode, dropCargo.lock. I deliberately did not fold the.vscodeaddition in here to keep this PR to the single line it is about.Co-Authored-By: Claude Opus 5 noreply@anthropic.com