From 9f9248deb1364639fbbcf172650d084d3f9a3ad0 Mon Sep 17 00:00:00 2001 From: rootiest Date: Fri, 12 Jun 2026 23:30:12 -0400 Subject: [PATCH] fix(agents-init): fix gitignore duplicate entries, add block comment style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Strip leading / from pattern before git check-ignore so root-anchored patterns like /AGENTS.md are checked as repo-relative paths (AGENTS.md) and correctly match existing rules — fixes duplicates on every run - Rework helper to accept multiple patterns and write them as a single labeled block with project-style header/footer comment rather than appending bare patterns one at a time - Move gitignore calls out of per-plug loop in --plugins mode so all three docs/ patterns are checked and written in one block - Remove 5 duplicate bare entries left in .gitignore by the broken runs --- functions/_agents_init_ensure_gitignore.fish | 85 +++++++++++++------- functions/agents-init.fish | 6 +- 2 files changed, 58 insertions(+), 33 deletions(-) diff --git a/functions/_agents_init_ensure_gitignore.fish b/functions/_agents_init_ensure_gitignore.fish index f19d6ec..f4f411a 100644 --- a/functions/_agents_init_ensure_gitignore.fish +++ b/functions/_agents_init_ensure_gitignore.fish @@ -2,54 +2,81 @@ # SPDX-License-Identifier: AGPL-3.0-or-later # SYNOPSIS -# _agents_init_ensure_gitignore +# _agents_init_ensure_gitignore