Repository navigation
fix: git-ignore-block.sh writes an exclude target only inside a real git dir (#431) - #448
Merged
kiki830621 merged 3 commits intoOct 31, 2026
Merged
Conversation
…git dir (#431) The #194 allowlist checked the basename alone, so any <dir>/exclude passed and mkdir -p created its parents — including /info/exclude, which the callers' "$(git rev-parse --git-dir)/info/exclude" becomes outside a work tree. An exclude target must now be <D>/info/exclude where `git --git-dir=<D> rev-parse --git-dir` succeeds; anything else exits 2 before any write. Test 10 covers the empty git-dir, a non-git info/, a <git-dir>/hooks/exclude, an arbitrary <dir>/exclude, and the relative .git/info/exclude the callers pass from the top level. Refs #431 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
…achment manifest Refs #431 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
…test harness guards (#431) From the /idd-verify report on #431 (all In-scope, no blocking): - refuse a --target containing a control character before the allowlist: `$(dirname …)` strips trailing newlines, so `<git-dir>⏎/info/exclude` passed the probe while the write landed in a non-git `.git⏎/` directory - require the git dir to be a directory: `git --git-dir` follows a .git FILE's gitdir: line, and nothing can be written under a file - test: every throwaway repo lives under one mktemp root removed on EXIT, and a repo that cannot be created stops the run (with R="" the old tests wrote to /.gitignore and /.git/info/exclude) - test: the /info/exclude case reports SKIP instead of vanishing when /info exists, and still runs when /info/exclude holds only this test's block - CHANGELOG: "outside any repository", not "outside a work tree" Refs #431 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TdBi8k2uM27M7TAdunMnmo
This was referenced Oct 30, 2026
Merged
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.
Refs #431
Summary
scripts/git-ignore-block.sh的 #194 allowlist 只比對 target 的 basename,任何<dir>/exclude都會被寫入,mkdir -p還會建出父目錄;呼叫端的"$(git rev-parse --git-dir)/info/exclude"在任何 repository 之外會變成/info/exclude。excludetarget 現在必須是<D>/info/exclude:<D>是目錄,且git --git-dir=<D> rev-parse --git-dir成功;含控制字元的--target會先被拒絕($(dirname …)會剝掉結尾換行)。不符合的一律在任何寫入之前 exit 2.git/info/exclude、子目錄、linked worktree 的 git dir、bare repo、submodule 的.git/modules/<m>、--git-path info/exclude,以及 PR 修復附件失敗、skill 路徑與 runtime ignore #402 新增的runtime-ignore.sh呼叫hooks/exclude、任意<dir>/exclude、換行、gitfile,以及相對路徑仍會生效。測試的暫存 repo 統一放在同一個 mktemp root;repo 建不起來時整個測試會停下,不會寫到/Verification
Claude-only verification PASS(雲端 session,沒有跑 Codex 那一條,屬於降級驗證)。詳見 issue #431 的 Verify comment:#431 (comment)
git-ignore-block41/41、stage45-carveout-migration23/23、correction-archive、correct-flow全過run-all-tests.sh:idd-repo-map、idd-tree-lock失敗,在乾淨的main上以 root 執行也一樣會失敗,與本 PR 無關Checklist
Related
$(git rev-parse --git-dir)/info/exclude指向 git 不讀的檔(呼叫端問題,sister concern).gitignore分支接受任何目錄、寫入失敗仍 exit 0(verify follow-up)[Unreleased]段落和 PR fix: idd-issue baseline-tag guard and exact label lookup; idd-update blank-line splice (#411, #412, #413) #442 以及同批的 rules/process-attachments.md 的 .gitignore 範例會連 _manifest.json 一起忽略 (sister concern from #420) #432、bug: plan-routing-consistency 測試掃到 gitignored .spectra/ snapshot — 乾淨 checkout 綠、跑過 spectra 的本機必紅 #335 PR 寫在同一個位置,merge 時會有純文字衝突idd-431-verified沒推上去(雲端 proxy 不允許推 tag),要在本機補打🤖 Generated by /idd-all. Do NOT add a GitHub close trailer (Closes/Fixes/Resolves) — IDD discipline requires manual /idd-close after merge to enforce checklist gate + closing summary.
Generated by Claude Code