-
Notifications
You must be signed in to change notification settings - Fork 200
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
Incorrect parsing of the prepared commit message #173
Comments
is there any solution? |
I created this PR @yiqianglin @axiac #196. Any thoughts? |
jan-molak
added a commit
to serenity-js/serenity-js
that referenced
this issue
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 issue
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
The support for prepared commit message introduced in version 6.2.1 (PR #122) is broken. It 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.
On the project I work on there is repository where several dozens of developers contribute with small changes. Most of the time they do not provide a long description to the commits because it is not needed. Everybody is used to just press
<Enter>
on the question about the long description.Let's see what happens in this case.
This is how the previous commit generated by this tool message looks like:
And this is the suggested answer on the question about the long description:
If I press
<Enter>
as I am used to, the lineISSUES CLOSED: #ABC-123
becomes the long description of the commit. AnotherISSUES CLOSED
line is added, of course, containing the Jira task ID that I provide on the question about the closed issues.The content of
.git/COMMIT_EDITMSG
becomes:On the next
yarn cz
, the suggested commit long description is:And so on, and so forth. If I keep pressing
<Enter>
to skip the long description, as my muscle memory has been trained in the last 4 years of using Commitizen, theISSUES CLOSED
lines keeps piling up in my commit messages.A possible solution for this issue is a configuration entry to enable/disable this functionality.
Commitizen and
cz-configurable
are installed in the project as dev dependencies andcz-customizable
is used as a Commitizen plugin, configured inpackage.json
as described in the documentation:Commitizen is executed using
yarn cz
, a script defined inpackage.json
:The text was updated successfully, but these errors were encountered: