Repository navigation
fix(recipe): refuse a typed answer git would read as an option - #41
Merged
Merged
Conversation
The 3,500 figure counted every row of the docs tables, including arguments, subcommands and environment variables. Rows for flags (starting with -) number 2,739.
A text answer passed alone as an argument, such as the new name in "git branch -m <old> <name>", reached git as an option when it started with a dash: "--force" ran as a flag instead of a name. Recipes now mark such questions at load time (not after "--" and not as the value of -m, -L, --path or -c), and the wizard refuses an answer for them that starts with "-". Commit messages and other option values may still start with a dash.
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.
A typed answer passed alone as an argument reached git as an option when it started with a dash. For example, "Rename a branch" with the new name
--forcerangit branch -m main --force.internal/recipe: when recipes load, eachtextquestion that a step passes alone ("{{.x}}") before--, and not as the value of-m,-L,--pathor-c, is markedNoLeadingDash.internal/ui: the wizard refuses an answer for those questions that starts with-, word by word for split answers, and asks again. Commit messages and other option values may still start with a dash.checkTextgets a unit test, and an end-to-end test renames a branch. That test fails without the fix.--before branch names, which no recipe did. It now describes this check. ARCHITECTURE has a matching line. Separately, the README now says about 2,700 flags (rows starting with-), not 3,500.Checks run locally: gofmt, go vet, go test ./..., golangci-lint (0 issues), node --test npm/lib.test.js, typos.