fix(cli): surface and safely remediate gitignore conflicts - #127
fix(cli): surface and safely remediate gitignore conflicts#127Traderfuz wants to merge 4 commits into
Conversation
|
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. |
Confidence Score: 4/5The 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 Files Needing Attention: src/gitignore-hygiene.ts Reviews (1): Last reviewed commit: "no-mistakes(document): Updated formattin..." | Re-trigger Greptile |
| const removed = await runner( | ||
| [ | ||
| "rm", | ||
| "--cached", | ||
| "--pathspec-from-file=-", | ||
| "--pathspec-file-nul", | ||
| "--ignore-unmatch", | ||
| ], | ||
| `${paths.join("\0")}\0`, | ||
| { GIT_INDEX_FILE: tempPath }, |
There was a problem hiding this comment.
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.
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
.gitignoreconflicts on the dashboard and before pull request creation, with TTY prompts, analwayspreference, report-only non-TTY behavior, and explicit--fix-ignore-conflictssupport.git rm --cached, preserving local files and avoiding commits, pushes, or deletes; shared preflight handling is wired through the CLI, dashboard, and PR commands.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 suggestsgh-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-conflictsflow.🔧 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.tsFocused 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.