Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

publish/sync fail with COMMIT_FAILED when the friction log is in a git-ignored directory

Open Beginner friendly
#87 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
82/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, typescript
Domain
cli

Research direction

The failure is in add in src/Git.ts, which runs git add -- <paths> on paths that may be git-ignored. The proposed fix adds a helper that runs git check-ignore --no-index and filters those paths out before staging, returning early if none remain. Start by reading add and commit in src/Git.ts, then write a test in a temp repo that ignores **/.agents/*. Done when Git.add resolves without staging ignored files, Git.commit returns false, and a non-ignored path is still staged.

Written by the indexing model from the issue text.

Description

publish and sync stage the entries they touched with git add -- <paths>. When the friction log lives in a git-ignored directory (for example .agents/friction-log/ under a .agents/* ignore rule), git add exits non-zero, and the command returns COMMIT_FAILED after the issues were already filed and the entries marked linked.

Seen with frog 1.1.0.

Proposed fix

Git.add drops paths that git check-ignore --no-index reports before it stages anything, and returns early when nothing is left. --no-index matches how git add walks the working tree: it refuses a path under an excluded directory even when that path is tracked.

diff --git a/src/Git.ts b/src/Git.ts
index e395e6a399e3f38efe537509ac421680bb8da18b..0612d749cf3375ab5f1ea404b15889fbee5aaf1c 100644
--- a/src/Git.ts
+++ b/src/Git.ts
@@ -137,13 +137,39 @@ export async function changedSince(
 }
 
 /**
- * Stages paths.
+ * Paths the repository's ignore rules exclude.
+ *
+ * `--no-index` matches how `git add` traverses the working tree: it refuses a path under an
+ * excluded directory even when that path is tracked. The index-aware default disagrees there, so it
+ * would leave the very failure this guards against. The cost is a tracked file matching a
+ * file-level rule, which `git add` would accept and this reports as excluded - a contradictory
+ * configuration, and one worth skipping rather than failing over.
+ *
+ * @param files - Repository-relative paths.
+ * @returns The subset the ignore rules exclude. Empty when git cannot answer.
+ */
+async function ignored(files: readonly string[], options: Options = {}): Promise<Set<string>> {
+  // Exit 1 means nothing matched; any other failure is treated the same way, leaving `add` to
+  // surface the real error.
+  const output = await git(['check-ignore', '--no-index', '--', ...files], options).catch(() => '')
+  return new Set(output ? output.split('\n') : [])
+}
+
+/**
+ * Stages paths, skipping the ones git ignores.
+ *
+ * A friction log kept in an ignored directory is still a complete publish: the entries are filed
+ * and marked linked, and there is nothing left to commit. Staging them would fail the whole command
+ * over paths the repository has deliberately excluded.
  *
  * @param files - Repository-relative paths. An empty list is a no-op.
  */
 export async function add(files: readonly string[], options: Options = {}): Promise<void> {
   if (files.length === 0) return
-  await git(['add', '--', ...files], options)
+  const excluded = await ignored(files, options)
+  const staged = files.filter((file) => !excluded.has(file))
+  if (staged.length === 0) return
+  await git(['add', '--', ...staged], options)
 }
 
 /**
Suggested test

A repo that ignores **/.agents/* with an entry under .agents/friction-log/<id>/friction.md. Git.add resolves without staging, Git.commit returns false, and a path that is not ignored is still staged.

Happy to open a PR with this change and the test if that helps.

Dominant language
TypeScript
Stars
267
Forks
11
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wevm/frog

All issues in wevm/frog

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.