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

fix: support prepared commit message #122

Merged
merged 5 commits into from
Jul 7, 2020
Merged

fix: support prepared commit message #122

merged 5 commits into from
Jul 7, 2020

Conversation

politician
Copy link
Contributor

@politician politician commented Jul 4, 2020

There are two kind of people:

  • Those who git commit
  • Those who git commit -m

cz-customizable is for those who git commit

With this PR, cz-customizable is now for everybody!

When used as a git hook, using git commit -m'my message' was not making use of 'my message'. Now it does.

This PR adds support for

  • single line commit messages. The message is passed as the default answer for the subject question
  • multi line commit messages. The first line is passed as the default answer for the subjectquestion and the other lines are passed as the default answer for the body question

It is non invasive as it is passed as a default to enquirer. So the user can just press enter to use it or type another message if he wishes to.

politician and others added 4 commits July 4, 2020 14:12
When used as a git hook, using git commit -m'my message' was not making use of 'my message'. Now it does.
@politician politician changed the title fix: support passed commit message fix: support prepared commit message Jul 4, 2020
@politician
Copy link
Contributor Author

@leonardoanalista Build is passing on my fork Build Status
If you are willing to merge, please do not forget to release a new version!

Thank you

@leonardoanalista
Copy link
Member

it look like Travis it stuck.. I'l have a loo today ok?

@leonardoanalista leonardoanalista merged commit 152565f into leoforfree:master Jul 7, 2020
@leonardoanalista
Copy link
Member

@Incorrupt release!

@politician
Copy link
Contributor Author

Cool thank you!

YvonneYu pushed a commit to thefirstweb/cz-customizable that referenced this pull request Nov 6, 2020
* 'master' of github.com:leoforfree/cz-customizable:
  fix: package url inside package.json after org creation (leoforfree#130)
  fix: update lodash security version
  feat: standalone version as global bin (leoforfree#129)
  build(deps): bump js-yaml from 3.12.2 to 3.13.1 (leoforfree#92)
  fix: support prepared commit message (leoforfree#122)
  build(deps): bump handlebars from 4.1.2 to 4.5.3 (leoforfree#110)
  docs: mention possible alternative path for config (leoforfree#123)
  subjectLimit option usage and validation (leoforfree#114)
@axiac
Copy link

axiac commented Mar 4, 2022

This is not a fix, it looks more like a new feature to me. And it breaks the habit to just press <Enter> to skip the answer to a question. If I keep pressing <Enter> on the question about the long description, it puts there the content of the previous commit message, without empty lines. On each subsequent execution, the message body keeps growing even if I do not enter anything there, just press <Enter> as my muscle memory trained during the last 4 years of using Commitizen with this plugin.

The parsing of the commit message body does not take into account the format of the commit message, the same commit message that has been generated by this tool on the previous commit. It includes into the suggested commit body the line ISSUES CLOSED that it finds the the previous commit message.

@leonardoanalista
Copy link
Member

@axiac looking at this again, yes, the prepared commit message breaks the ENTER habit. Please see: #196 @axiac

jan-molak added a commit to serenity-js/serenity-js that referenced this pull request Aug 25, 2022
…ggest, interrupting the flow

With the introduction of http://leoforfree/cz-customizable#122, cz-customizable pre-populates the
subject and the body of the commit message with whatever values the _previous_ commit message had.
When a commit message is long, this interrupts the developer workflow as a lengthy, non-editable
string of text derived from the previous commit takes up all the space for the _current_ commit and
confuses Inquirer CLI, which starts to render the cursor in an invalid location

Related tickets: re leoforfree/cz-customizable#196, re leoforfree/cz-customizable#196
jan-molak added a commit to serenity-js/serenity-js that referenced this pull request Aug 25, 2022
…ggest, interrupting the flow

With the introduction of leoforfree/cz-customizable#122, cz-customizable pre-populates the
subject and the body of the commit message with whatever values the _previous_ commit message had.
When a commit message is long, this interrupts the developer workflow as a lengthy, non-editable
string of text derived from the previous commit takes up all the space for the _current_ commit and
confuses Inquirer CLI, which starts to render the cursor in an invalid location

Related tickets: re leoforfree/cz-customizable#173, re leoforfree/cz-customizable#196
jan-molak added a commit to serenity-js/serenity-js that referenced this pull request Aug 25, 2022
…ggest, interrupting the flow

With the introduction of leoforfree/cz-customizable#122, cz-customizable pre-populates the
subject and the body of the commit message with whatever values the _previous_ commit message had.
When a commit message is long, this interrupts the developer workflow as a lengthy, non-editable
string of text derived from the previous commit takes up all the space for the _current_ commit and
confuses Inquirer CLI, which starts to render the cursor in an invalid location

Related tickets: re leoforfree/cz-customizable#173, re leoforfree/cz-customizable#196
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants