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

Revisit commit message processing #1500

Merged
merged 11 commits into from Jun 1, 2018

Conversation

Projects
None yet
1 participant
@smashwilson
Copy link
Member

smashwilson commented Jun 1, 2018

Revisit the ways that we preprocess commit messages - both in JavaScript and in choosing a --cleanup argument to git commit - to better handle some edge cases and bugs.

  • Fixes #1465. It turns out that GitShellOutStrategy.getHeadCommit() was stripping newlines from the message body of any parsed commit, which was altering amended commit messages. Added --cleanup=verbatim as well to ensure that the message isn't manipulated by git either.
  • Fixes #1382 by adding a {verbatim} option to GitShellOutStrategy.commit(). When set to true, the message argument is used for the commit exactly as-is. When set to false, if commit.cleanup is set to a value and is not "default", default to "strip".
    • Don't generate the "merge text" commit message template when a merge is detected (because we would no longer strip out the # lines).
    • Set {verbatim: true} when committing from the mini editor, but not from a full editor.

Note that I'm defaulting --cleanup to "strip" for non-verbatim commits instead of "whitespace". My logic here is that committing through Atom with a full-editor message feels more like editing a message in $EDITOR and committing than it does doing a commit -m, so we want to act like git "when the message is to be edited":

Same as strip if the message is to be edited. Otherwise whitespace.

smashwilson added some commits May 31, 2018

smashwilson added some commits Jun 1, 2018

@smashwilson smashwilson merged commit 81c6bf2 into master Jun 1, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@smashwilson smashwilson deleted the aw/commit-message-wrapping branch Jun 1, 2018

smashwilson added a commit that referenced this pull request Jun 1, 2018

Merge pull request #1500 from atom/aw/commit-message-wrapping
Revisit commit message processing

smashwilson added a commit that referenced this pull request Jun 1, 2018

Merge pull request #1500 from atom/aw/commit-message-wrapping
Revisit commit message processing

smashwilson added a commit that referenced this pull request Jun 1, 2018

Merge pull request #1500 from atom/aw/commit-message-wrapping
Revisit commit message processing
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.