Add -g+ / -g- short spellings for gitignore on/off (#95) - #223
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes the short forms of the
-ggitignore ternary:-g(bare) = auto (respect.gitignoreonly in a git repo) - shipped in Add xff/repo + -g auto mode: respect .gitignore only in a git repo (#95) #222.-g+=--gitignore=on(force on regardless of repo).-g-=--gitignore=off(force off).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
--gitignoredisplay (--gitignore[=on|off], -g[+|-]) + summary and thekHelpTextline show the short forms;design.mdmoves-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/excludeandcore.excludesFile- these hit a repo-scoping design question (how far above the search root ignore resolution reaches); raised separately for a decision before building.