fix(gi): stop --stdout from leaking to .gitignore, rework flags #178

Merged
rootiest merged 1 commits from fix/gi-stdout-flag-rework into main 2026-09-24 04:53:38 +00:00
Owner

Bug

gi --stdout in a fresh repo (no other args/flags) fell through to gi's default mode, which runs boilerplate + prompt. Only the direct-target branch ever checked the stdout flag, so the default-mode path ignored it and appended boilerplate straight to the real .gitignore instead of printing it.

Fixed by making the boilerplate and prompt modes stdout-aware too, and by not requiring a git repo at all when --stdout is set (nothing gets written, so nothing needs a .gitignore path).

Flag rework

For consistency with the rest of the config's CLI conventions:

  • -s/--silent (was --stdout): now the standard silent mode — suppresses progress output (Notice:/✔ Appended...) only. Errors and the interactive prompt still show.
  • -o/--stdout (was -s): prints generated content to stdout instead of writing/appending to .gitignore.
  • -f/--force: new. Bypasses the interactive pattern prompt and proceeds with the default action (no patterns), for scripting/automation.

Testing

  • fish -n functions/gi.fish — syntax OK
  • fish tests/test-network-fish.fish — 67/67 passed (renamed -s→-o in the existing stdout tests, added a regression test for the default-mode + -o fix)
  • fish tests/run-tests.fish — full suite green, exit 0

docs/fish-config.md updated by hand to match (CI regenerates it from function docstrings anyway; this keeps it in sync in the meantime). The gitignored docs/site/ mirror is CI-generated and untouched.

## Bug `gi --stdout` in a fresh repo (no other args/flags) fell through to `gi`'s default mode, which runs boilerplate + prompt. Only the direct-target branch ever checked the stdout flag, so the default-mode path ignored it and appended boilerplate straight to the real `.gitignore` instead of printing it. Fixed by making the boilerplate and prompt modes stdout-aware too, and by not requiring a git repo at all when `--stdout` is set (nothing gets written, so nothing needs a `.gitignore` path). ## Flag rework For consistency with the rest of the config's CLI conventions: - **`-s`/`--silent`** (was `--stdout`): now the standard silent mode — suppresses progress output (`Notice:`/`✔ Appended...`) only. Errors and the interactive prompt still show. - **`-o`/`--stdout`** (was `-s`): prints generated content to stdout instead of writing/appending to `.gitignore`. - **`-f`/`--force`**: new. Bypasses the interactive pattern prompt and proceeds with the default action (no patterns), for scripting/automation. ## Testing - `fish -n functions/gi.fish` — syntax OK - `fish tests/test-network-fish.fish` — 67/67 passed (renamed `-s`→`-o` in the existing stdout tests, added a regression test for the default-mode + `-o` fix) - `fish tests/run-tests.fish` — full suite green, exit 0 `docs/fish-config.md` updated by hand to match (CI regenerates it from function docstrings anyway; this keeps it in sync in the meantime). The gitignored `docs/site/` mirror is CI-generated and untouched.
rootiest added 1 commit 2026-09-24 01:40:52 +00:00
fix(gi): stop --stdout from leaking to .gitignore, rework flags
CI / github-mirror (pull_request) Skipped
CI / docs (pull_request) Successful in 20s
CI / test (pull_request) Successful in 2m16s
82bea2f539
--stdout silently fell through to the append path whenever gi ran in
its default (no-args) mode, since only the direct-target branch ever
checked it. A fresh-repo `gi --stdout` wrote boilerplate straight to
.gitignore instead of printing it.

Flags also get reworked for consistency:
- -s/--silent: suppress progress output only, errors and prompts still show
- -o/--stdout: print generated content to stdout instead of .gitignore (was -s)
- -f/--force: bypass the interactive prompt, proceed with no patterns

stdout mode also no longer requires a git repo, since it never
touches .gitignore.
rootiest added the Kind/BugArea/Functions labels 2026-09-24 01:41:04 +00:00
rootiest merged commit 1f3c8f41e7 into main 2026-09-24 04:53:38 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rootiest/fish-config#178