Repository navigation
feat: warn before committing directly on main, master or develop - #61
Merged
Merged
Conversation
Closes #30. In GitFlow those branches receive changes through pull requests. stc commit now warns, suggests starting a branch with stc git start and asks for confirmation (default no). The VS Code commit command shows the same warning with Start a new branch and Commit anyway. @stackcode/core exports getCurrentBranch, isProtectedBranch and DEFAULT_PROTECTED_BRANCHES, tested against a real repository. Messages are available in English, Portuguese and Spanish.
…branch-warning # Conflicts: # packages/vscode-extension/src/commands/CommitCommand.ts
Merged
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.
Closes #30
In GitFlow,
main/masteranddevelopreceive changes through pull requests.stc commitdetects the current branch; on a protected one it explains the problem, suggestsstc git startand asks for confirmation (default no) before the wizard.stackcode.git.start) and Commit anyway; dismissing it cancels.getCurrentBranch,isProtectedBranchandDEFAULT_PROTECTED_BRANCHESare exported from@stackcode/core.Tests: core helpers against a real temporary repository (5), CLI commit flow on protected and feature branches (3 new), VS Code commit command start-branch / dismiss / commit-anyway (3 new).