Skip to contentSkip to conversation

gitignore: ignore ltp-agent setup files

PATCH Superseded Andrea Cervesato 2 participants 2 messages Jun 1

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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
index f10cd0c80e3655ad720e465f47c12ad0d51e7cd1..d68769451103e22c3e3a4d6c80f824e2412f0ae4 100644
@@ -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
#1 lore raw

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
    +/.claude

With 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