This repository was archived by the owner on Dec 15, 2022. It is now read-only.
respect core.commentChar
from git settings.
#1988
Merged
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.
Description of the Change
If a user is using commit templates, previously we were assuming their comment character is
#
. Git provides the ability to set a custom comment char. This change respects a custom comment character the user has set and strips lines beginning with that character from the commit message.Also, I made the original unit test for stripping
#
from commit message templates more robust, by adding some lines to the commit message that start with '#'. There were lines in the commit message template that start with '#', but we aren't actually doing anything with the template ingitShellOutStrategy.commit
other than checking for existence, so that test wasn't checking anything very meaningful.Screenshot/Gif
N/A
Alternate Designs
None.
Benefits
Users who have set a custom comment character will be able to make commits and ensure that commented characters are properly stripped.
Possible Drawbacks
There's always the risk of introducing additional bugs. Other than that, can't think of any.
Applicable Issues
#1909
Metrics
N/A
Tests
core.commentChar
in local git settings, setting a commit template that contained lines that start with that character, making a commit, and verifying that lines that started with that character are stripped out of the commit.core.commentChar
, setting a commit template, making a commit, and verifying that lines that started with#
were still stripped out of the ensuing commit message.Documentation
N/A
Release Notes
Fixed bug with commit message templates in the GitHub package -- now, lines starting with
core.commentChar
are stripped ifcore.commentChar
is set in local git settings.User Experience Research (Optional)
N/A