Skip to content

chore(gitignore): ignore *.prev, the backup a rewrite leaves behind - #1879

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/gitignore-prev
Sep 25, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/gitignore-prev

Conversation

@lilyshen0722

@lilyshen0722 lilyshen0722 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #1878, asked for separately by @vera — not folded into it.

Nine *.test.js.prev copies reached a commit this week (ba2a2b3b on the Row D branch, removed again in 3f73aae0). Nothing ignored the suffix: git check-ignore exited 1 on all nine, so a scratch rewrite script's backups were ordinary untracked files that any git add -A would sweep in. *.bak was already ignored — twice, at :2 and :33; this adds the sibling suffix beside the first and removes the duplicate.

The measurement, both directions

A file at the path the incident actually used — backend/__tests__/unit/routes/slackOAuth.installables.test.js.prev:

Before, on f5ded480 (this branch's base, in a clean worktree):

$ git status --porcelain
?? backend/__tests__/unit/routes/slackOAuth.installables.test.js.prev
$ git check-ignore -v backend/.../slackOAuth.installables.test.js.prev
$ echo $?
1

After, at 36995c52:

$ git check-ignore -v backend/.../slackOAuth.installables.test.js.prev
.gitignore:3:*.prev	backend/__tests__/unit/routes/slackOAuth.installables.test.js.prev
$ git status --porcelain
 M .gitignore

The same file, invisible.

What is not here

No test. This repo has no test that reads .gitignore — grep -l 'gitignore\|check-ignore' across backend/__tests__ and frontend/src/**/__tests__ returns nothing — so a witness here would be the first of its kind and would have to shell out to git for a rule that git already enforces. The command output above is the evidence instead; say the word if you'd rather have the guard.

No version bump. Root .gitignore is not package source, so no version slot moves. An earlier draft of this body said the Source changed ⇒ version bumped check was "expected to skip" — that was wrong about the mechanism, and the measured result is better than the prediction: the job runs and PASSES in 9s. It walks each published package with git diff BASE...HEAD -- "$pkg/src" and reports · $pkg: no src changes, so a root-only change passes it rather than skipping it. The one check on this head that skips is main carries no duplicate ADR number.

Untouched: *.orig and the rest of the merge-residue family. Only the suffix that had a live incident.

Nine `*.test.js.prev` copies reached main's history this week (#1878,
`ba2a2b3b`) and `git check-ignore` exited 1 on every one of them — nothing
ignored the suffix, so a scratch rewrite script's backups were fair game for
staging.

`*.bak` was already ignored, twice (`:2` and `:33`); the sibling suffix goes
beside it and the duplicate goes away.
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 25, 2026
Merged via the queue into main with commit a291395 Sep 25, 2026
13 checks passed
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