Skip to content

Add -g+ / -g- short spellings for gitignore on/off (#95) - #223

Merged
helly25 merged 1 commit into
mainfrom
feat/gitignore-plus-minus-spelling
Jul 3, 2026
Merged

Add -g+ / -g- short spellings for gitignore on/off (#95)#223
helly25 merged 1 commit into
mainfrom
feat/gitignore-plus-minus-spelling

Conversation

@helly25

@helly25 helly25 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Completes the short forms of the -g gitignore ternary:

Recognized in ResolveGitignoreMode (last occurrence wins). No parser change needed - the parser already collects leading dash tokens as globals verbatim, so -g+ / -g- arrive as global strings and are interpreted here.

Self-documentation

--gitignore display (--gitignore[=on|off], -g[+|-]) + summary and the kHelpText line show the short forms; design.md moves -g+/-g- from pending to shipped.

Tests

ignore_gitignore_test.sh: -g+ forces on outside a repo (no .git), -g- forces off inside a repo (overriding auto-on).

bazel test //... green (43); both clang-format versions + shfmt/shellcheck clean.

Remaining under #95

.git/info/exclude and core.excludesFile - these hit a repo-scoping design question (how far above the search root ignore resolution reaches); raised separately for a decision before building.

Complete the -g ternary's short forms: -g+ == --gitignore=on (force on),
-g- == --gitignore=off (force off), alongside the existing bare -g = auto.
Both are recognized in ResolveGitignoreMode (last occurrence wins); no
parser change is needed since leading dash tokens are already collected as
globals verbatim.

Self-doc: --gitignore display + summary and the kHelpText line show the
-g[+|-] forms; design.md moves them from pending to shipped. Tests:
ignore_gitignore_test.sh gains -g+ forces on outside a repo and -g- forces
off inside a repo (overriding the auto-on).

Remaining under #95: .git/info/exclude and core.excludesFile.
@helly25
helly25 enabled auto-merge (squash) July 3, 2026 18:02
@helly25
helly25 merged commit cab8788 into main Jul 3, 2026
8 checks passed
@helly25
helly25 deleted the feat/gitignore-plus-minus-spelling branch July 3, 2026 18:07
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