Skip to content

chore: delete the committed root screenshot --full-page, ignore dash-prefixed root files - #3195

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-3193-remove-root-screenshot
Aug 2, 2026
Merged

chore: delete the committed root screenshot --full-page, ignore dash-prefixed root files#3195
os-zhuang merged 1 commit into
mainfrom
claude/issue-3193-remove-root-screenshot

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Fixes #3193

现象

main 的仓库根目录里躺着一个被 git 跟踪的 68KB PNG(1280×577),文件名就叫 --full-page —— 某次截图命令的 CLI 参数落进了输出文件名的位置,随 #3085 一起提交进来。此后每次 git worktree add 都会把它带进新树。

为什么兜底没拦住

AGENTS.md「Housekeeping」承诺 .gitignore 已锚定 /*.png 做防兜底,但这个文件没有扩展名 —— 参数本身就是文件名 —— 所以 /*.png 匹配不到。漏的形状是「按内容是图片、但没有后缀可匹配的根文件」。

改动(按 issue 的建议 1 + 建议 2)

  1. 删除:git rm -- './--full-page'
  2. 收紧兜底:.gitignore 新增根级 /--*。它按形状而不是按内容类型来拦 —— 仓库根下不存在以参数名命名的正当文件,所以根目录里任何以 -- 开头的条目按构造就是参数解析事故。规则锚定在根,嵌套路径(packages/**/--foo)不受影响,仍会正常出现在 git status 里。
  3. AGENTS.md:把 Housekeeping 里那条如实改成描述现在的兜底,并补上「删这类文件要用 -- 断开参数解析」这个附带的坑。
  4. changeset:沿用仓库既有的 release-nothing 空 changeset 写法(空 frontmatter),不发任何包。

验证

纯仓库卫生改动,没有可测的运行时行为,因此用 git check-ignore -v 取证(在本分支的 worktree 里造了三个临时文件,验完已删):

$ git check-ignore -v -- './--full-page' './--output' './--screenshot.png'
.gitignore:79:/--*      ./--full-page
.gitignore:79:/--*      ./--output
.gitignore:79:/--*      ./--screenshot.png

$ git check-ignore -v -- './packages/.ignoretest/--nested-not-root'
exit=1        # 锚在根,嵌套路径不受影响

$ node scripts/check-changeset-fixed.mjs
✅  All workspace packages are in the changeset fixed group.

文件确实从索引里消失了:

$ git ls-files -- './--full-page'
        # 空

一处请维护者拍板(可直接在此 PR 否决)

/--* 只拦双横杠。更宽的 /-* 会把单横杠短参数(-p-o)造成的事故也一起拦掉,代价是根目录下任何以单个 - 开头的正当文件都会被静默忽略(目前仓库里没有这种文件)。这里按 PM 分诊裁定选了较窄的 /--*,因为长参数是这类事故的绝对多数形状;要放宽只是改一行。


🤖 Generated with Claude Code

https://claude.ai/code/session_01PRJtkgUAaVG11FsJQbvZWA


Generated by Claude Code

…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
@vercel

vercel Bot commented Aug 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Aug 2, 2026 11:01am

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 2, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 2, 2026 11:30
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 2, 2026
Merged via the queue into main with commit 26196cc Aug 2, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-3193-remove-root-screenshot branch August 2, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

仓库根有一个被提交进来的截图:文件名 --full-page(68KB PNG),.gitignore/*.png 锚点拦不住它

2 participants