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

Problems with commit message titles start with # #736

Open
yizeng opened this issue Dec 27, 2020 · 0 comments
Open

Problems with commit message titles start with # #736

yizeng opened this issue Dec 27, 2020 · 0 comments

Comments

@yizeng
Copy link

yizeng commented Dec 27, 2020

I'm facing this obscure issue that with commit message titles start with # (e.g. #16: This is a sample commit for the issue 16)

Behaviours:

Without Overcommit (or after overcommit --uninstall)

  • No problems with commit messages start with #

With Overcommit

  • With the default Git config
    • Git will clean up and strip the commit title, so it becomes empty
    • Then overcommit rejects it due to EmptyMessage rule (which is the correct behaviour of course)
  • With git config --global core.commentchar ';' set
    • Git still cleans up and strips the commit title with #, so it becomes empty again
    • Then overcommit ignores the empty message and doesn't reject the commit (even if EmptyMessage is enabled by default)
  • With git config --global commit.cleanup whitespace set
    • Maybe I'm doing something wrong here. Setting git commit.cleanup mode has no effect on anything. The commit message is still gone and overcommit is rejecting the empty message.
  • Use git commit -m "#16: This is a sample commit for the issue 16" --cleanup=whitespace
    • Same as above. No effect when it should.
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

No branches or pull requests

1 participant