gitignore: ignore ltp-agent setup files
PATCH v2 1/1 gitignore: ignore ltp-agent setup files
From: Andrea Cervesato <[email protected]>
The ltp-agent tool injects a number of files and symlinks into the LTP working directory at runtime (AGENTS.md, GEMINI.md, .agents, .claude, and the agents/, linter/ and skills/ symlinks pointing at the agent data). These are local helpers used by the agent and must never be tracked or committed.
Directory entries are anchored to the repository root (leading '/') so they only match the ltp-agent-injected paths and cannot accidentally shadow any unrelated subdirectory with the same name in the future.
---
Changes in v2:
- fix files shadowing
- Link to v1: https://lore.kernel.org/r/[email protected]
--- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+)
.gitignore +9 -0
@@ -63,3 +63,12 @@ compile_commands.json # added by scripts/checkpatch.pl .checkpatch-camelcase.* + +# ltp-agent setup +AGENTS.md +GEMINI.md +.agents +.claude +/agents/ +/linter/ +/skills/
---
base-commit: 5ccf816f5d0e6c0ec3d808be456dd9ffa2a7736d
change-id: 20260530-gitignore_ltp_agent-0c7c137b6156
Best regards,
Signature · 5 lines
Andrea Cervesato <[email protected]> -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Andrea,
Thank you for the patch. Please find review comments below.
---
**Patch**: gitignore: ignore ltp-agent setup files **Verdict**: Needs revision ✗
---
## Commit Message
The commit message is mostly well written. However, there is a precision issue with the body:
Quoted 3 lines
Directory entries are anchored to the repository root (leading '/') so they only match the ltp-agent-injected paths and cannot accidentally shadow any unrelated subdirectory with the same name in the future.
This is technically true for the three directory entries (/agents/, /linter/, /skills/), but the same rationale applies equally to the four file/hidden-directory entries (AGENTS.md, GEMINI.md, .agents, .claude) which are NOT anchored. The justification for anchoring — preventing accidental shadowing — applies to all seven entries, not only the directory ones.
## Code Review
**File**: .gitignore
### Issue 1: Non-directory entries should also be anchored [Needs revision]
The three directory symlinks are correctly anchored:
/agents/
/linter/
/skills/
But the remaining four entries are not:
AGENTS.md
GEMINI.md
.agents
.claude
In git's pattern language, a pattern without a leading / is matched recursively throughout the entire working tree. So AGENTS.md would silently ignore any file named AGENTS.md anywhere inside the repository — including inside testcases/ or any other subdirectory a future contributor might create. Since all four of these are exclusively injected at the repository root by ltp-agent, they should be anchored with a leading / for the same reason the directory entries are, and for consistency with them.
**Suggested fix** — replace the four non-anchored entries:
-AGENTS.md
-GEMINI.md
-.agents
-.claude
+/AGENTS.md
+/GEMINI.md
+/.agents
+/.claudeWith this change the commit-message body can also be updated to say "All entries are anchored to the repository root …" for accuracy.
---
LTP AI Reviewer
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp