chore: delete the committed root screenshot --full-page, ignore dash-prefixed root files - #3195
Merged
Merged
Conversation
…h-prefixed root files A tracked 68KB PNG (1280x577) named literally `--full-page` sat in the repository root: a screenshot CLI flag that landed in the output-filename slot and was committed alongside #3085. Every `git worktree add` since materialised it into a fresh tree. The root-anchored `/*.png` guard could not catch it — the file has no extension to match on, because the flag *is* the name. `.gitignore` now also ignores `/--*`, matching the accident by shape instead of content type: nothing legitimate lives at the repository root under a flag name. Nested paths are unaffected. AGENTS.md Housekeeping is updated to state the guard accurately, and to note that removing such a file needs `--` to stop argument parsing (`git rm -- './--full-page'`). Fixes #3193 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PRJtkgUAaVG11FsJQbvZWA
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
os-zhuang
marked this pull request as ready for review
August 2, 2026 11:30
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.
Fixes #3193
现象
main的仓库根目录里躺着一个被 git 跟踪的 68KB PNG(1280×577),文件名就叫--full-page—— 某次截图命令的 CLI 参数落进了输出文件名的位置,随 #3085 一起提交进来。此后每次git worktree add都会把它带进新树。为什么兜底没拦住
AGENTS.md「Housekeeping」承诺
.gitignore已锚定/*.png做防兜底,但这个文件没有扩展名 —— 参数本身就是文件名 —— 所以/*.png匹配不到。漏的形状是「按内容是图片、但没有后缀可匹配的根文件」。改动(按 issue 的建议 1 + 建议 2)
git rm -- './--full-page'。.gitignore新增根级/--*。它按形状而不是按内容类型来拦 —— 仓库根下不存在以参数名命名的正当文件,所以根目录里任何以--开头的条目按构造就是参数解析事故。规则锚定在根,嵌套路径(packages/**/--foo)不受影响,仍会正常出现在git status里。--断开参数解析」这个附带的坑。验证
纯仓库卫生改动,没有可测的运行时行为,因此用
git check-ignore -v取证(在本分支的 worktree 里造了三个临时文件,验完已删):文件确实从索引里消失了:
一处请维护者拍板(可直接在此 PR 否决)
/--*只拦双横杠。更宽的/-*会把单横杠短参数(-p、-o)造成的事故也一起拦掉,代价是根目录下任何以单个-开头的正当文件都会被静默忽略(目前仓库里没有这种文件)。这里按 PM 分诊裁定选了较窄的/--*,因为长参数是这类事故的绝对多数形状;要放宽只是改一行。🤖 Generated with Claude Code
https://claude.ai/code/session_01PRJtkgUAaVG11FsJQbvZWA
Generated by Claude Code