Skip to content

fix(cli): surface and safely remediate gitignore conflicts - #127

Closed
Traderfuz wants to merge 4 commits into
kunchenguid:mainfrom
Traderfuz:wt/gitignore-tracking-hygiene-clean
Closed

fix(cli): surface and safely remediate gitignore conflicts#127
Traderfuz wants to merge 4 commits into
kunchenguid:mainfrom
Traderfuz:wt/gitignore-tracking-hygiene-clean

Conversation

@Traderfuz

Copy link
Copy Markdown

Intent

gh-axi automatically surfaces tracked repository-.gitignore conflicts on dashboard and before PR creation; TTY asks once with yes/no/always; fixes only untrack via git rm --cached preserving local files; report-only/non-TTY unless explicit --fix-ignore-conflicts; local Always preference; no commit/push/delete by hygiene; reusable push-preflight boundary; tests/docs included.

What Changed

  • Added reusable gitignore hygiene detection and remediation that surfaces tracked .gitignore conflicts on the dashboard and before pull request creation, with TTY prompts, an always preference, report-only non-TTY behavior, and explicit --fix-ignore-conflicts support.
  • Remediation only untracks conflicting files with git rm --cached, preserving local files and avoiding commits, pushes, or deletes; shared preflight handling is wired through the CLI, dashboard, and PR commands.
  • Added comprehensive tests and updated user-facing documentation, help examples, and installed skill guidance.

Risk Assessment

✅ Low: The changed hygiene detection, explicit and interactive repair paths, atomic index handling, dashboard/PR integration, and remediation guidance are consistent with the stated intent; no material source-verifiable defects were found.

Testing

Ran 173 focused behavioral tests across hygiene, dashboard, PR creation, CLI routing, and help surfaces. The tests passed, and the worktree remained clean; no UI artifact applies to this CLI-only change.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ src/commands/home.ts:110 - The dashboard reports hygiene findings but suggests gh-axi hygiene, a command that does not exist. Users following the guidance receive an unknown-command error; point them to the supported dashboard invocation or explicit --fix-ignore-conflicts flow.

🔧 Fix: Fixed dashboard hygiene remediation command
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • pnpm exec vitest run test/gitignore-hygiene.test.ts test/commands/home.test.ts test/commands/pr.test.ts test/cli.test.ts test/help-examples.test.ts
  • Focused tests exercised temporary Git repositories, detection, report-only behavior, explicit repair, local-file preservation, Always preference, dashboard routing, and PR preflight wiring.
  • git diff --check ...
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@Traderfuz

Copy link
Copy Markdown
Author

Closing this PR because advisory session-start context hooks added three unrelated files (.dev-os/notepad.md, AGENTS.md, CLAUDE.md). The feature will be republished from a clean branch with those hooks paused and restored after validation.

@Traderfuz Traderfuz closed this Aug 26, 2026
@greptile-apps

greptile-apps Bot commented Aug 26, 2026

Copy link
Copy Markdown

Confidence Score: 4/5

The repair path should be fixed before merging because invocation from a repository subdirectory can claim conflicts were repaired while leaving them tracked.

The new remediation passes root-relative findings to a cwd-relative git rm with --ignore-unmatch, then treats the requested path count as proof of success, producing a reachable false-success result.

Files Needing Attention: src/gitignore-hygiene.ts

Reviews (1): Last reviewed commit: "no-mistakes(document): Updated formattin..." | Re-trigger Greptile

Comment thread src/gitignore-hygiene.ts
Comment on lines +206 to +215
const removed = await runner(
[
"rm",
"--cached",
"--pathspec-from-file=-",
"--pathspec-file-nul",
"--ignore-unmatch",
],
`${paths.join("\0")}\0`,
{ GIT_INDEX_FILE: tempPath },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Subdirectory Repairs Report Success

When repair runs from a repository subdirectory, these repository-root-relative paths are resolved against the current directory, so git rm --ignore-unmatch can remove nothing but still succeed, causing the command to report fixed while the conflicts remain tracked.

@Traderfuz
Traderfuz deleted the wt/gitignore-tracking-hygiene-clean branch August 27, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant