Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respect `core.commentChar` from git settings. #1988

Merged
merged 3 commits into from Feb 27, 2019

Conversation

Projects
2 participants
@annthurium
Copy link
Contributor

annthurium commented Feb 26, 2019

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 in gitShellOutStrategy.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

  • Manual testing setting 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.
  • Manual tested unsetting 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.
  • Added unit test to ensure that lines that start with core.commentChar are stripped from commit messages

Documentation

N/A

Release Notes

Fixed bug with commit message templates in the GitHub package -- now, lines starting with core.commentChar are stripped if core.commentChar is set in local git settings.

User Experience Research (Optional)

N/A

@annthurium annthurium requested a review from atom/github-package Feb 26, 2019

@codecov

This comment has been minimized.

Copy link

codecov bot commented Feb 26, 2019

Codecov Report

Merging #1988 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1988      +/-   ##
==========================================
+ Coverage   92.12%   92.12%   +<.01%     
==========================================
  Files         188      188              
  Lines       10806    10809       +3     
  Branches     1581     1582       +1     
==========================================
+ Hits         9955     9958       +3     
  Misses        851      851
Impacted Files Coverage Δ
lib/git-shell-out-strategy.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2bc2ca...507f686. Read the comment docs.

@smashwilson
Copy link
Member

smashwilson left a comment

Nice!

@annthurium annthurium merged commit 3ce6051 into master Feb 27, 2019

2 checks passed

codecov/patch 100% of diff hit (target 92.12%)
Details
codecov/project 92.12% (+<.01%) compared to e2bc2ca
Details

Sprint : 13 February 2019 - 5 March 2019 : v0.27.0 automation moved this from In progress to Merged Feb 27, 2019

@annthurium annthurium deleted the tt-19-feb-core-commentchar branch Feb 27, 2019

@vanessayuenn vanessayuenn referenced this pull request Mar 6, 2019

Closed

v0.27.0-0 QA Review #2005

7 of 9 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.