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

Clarification on recent multi-line change #80

Closed
snuggie12 opened this issue Dec 12, 2023 · 6 comments · Fixed by #87
Closed

Clarification on recent multi-line change #80

snuggie12 opened this issue Dec 12, 2023 · 6 comments · Fixed by #87
Labels
bug Something isn't working question Further information is requested

Comments

@snuggie12
Copy link

In #68 there's now a check for an extra blank line. Given the wording in the release notes and in the output message if you fail the check I more read this as you need a blank line if you have a body:

Conventional Commits start with one of the below types, followed by a colon, followed by the commit subject and an optional body seperated by a blank line:

I require a blank line even if I don't supply a body.

I think there are a few possibilities here:

  • This was unintentional and we need to fix
  • This was intentional and I feel the messaging could be a bit clearer

If the 2nd one, what do you think about drawing more attention to it in the program? Can it be made bold or surrounded by *** or something to draw attention to it for a few versions and then special messaging can be deprecated?

@snuggie12
Copy link
Author

snuggie12 commented Dec 12, 2023

It appears to work if you use -m to provide your message. However, if using an editor it breaks.

@nikolaik
Copy link
Contributor

nikolaik commented Jan 2, 2024

Is this because when using an editor it usually adds a newline at the end of the file, tripping up the regex?

@snuggie12
Copy link
Author

snuggie12 commented Jan 2, 2024

Is this because when using an editor it usually adds a newline at the end of the file, tripping up the regex?

@nikolaik sort of but the opposite. The editor adds comments. The regex sees this as multiline and therefore requires an additional blank line. So the fix would be to treat comments as comments and determine the message as a single line and therefore no blankline is required. Example of the breaking commit in the editor below:

fix: test message
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch foo
# Your branch is up to date with 'origin/foo'.
#
# Changes to be committed:
#       modified:   foo

@thekaveman thekaveman added question Further information is requested bug Something isn't working labels Jan 10, 2024
@thekaveman
Copy link
Member

Thank you @snuggie12 and @nikolaik for the report and conversation.

I'd say this is a bug in our implementation -- we should definitely support commit messages from an editor, in addition to the command line. My workflow is mostly the latter, so I probably missed this detail for editor-based messages.

A PR to fix this would be most welcome!

@nikolaik
Copy link
Contributor

Gave a try at handling this in #87

@thekaveman thekaveman linked a pull request Jan 12, 2024 that will close this issue
@thekaveman
Copy link
Member

Thanks again for the report @snuggie12 and your work on this @nikolaik

3.1.0 has been released in GitHub and PyPI with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants