Skip to content

Conversation

@jawshooah
Copy link
Collaborator

This hook will fail if the commit message is empty or contains only whitespace. Enabled by default, as I suspect this is something most users would never do intentionally.

Refs #201

This hook will fail if the commit message is empty or contains
only whitespace.
@lencioni
Copy link
Collaborator

lencioni commented May 3, 2015

👍

@sds
Copy link
Owner

sds commented May 3, 2015

Not entirely sure this is necessary, as git seems to already prevent you from creating empty commits.

$ mkdir test
$ cd test
$ git init
$ git commit --allow-empty -m " "
Aborting commit due to empty commit message.

@lencioni
Copy link
Collaborator

lencioni commented May 3, 2015

Oh yeah, that's a good point. I wonder if there are any versions in popular use where this isn't the case?

@jawshooah
Copy link
Collaborator Author

$ git commit --allow-empty --allow-empty-message -m " "

@lencioni
Copy link
Collaborator

lencioni commented May 3, 2015

Oh, looks like you can pass --allow-empty-message in newer versions, so this still probably makes sense.

@sds sds added the enhancement label May 3, 2015
@sds
Copy link
Owner

sds commented May 3, 2015

Why there exists an --allow-empty-message flag in the first place is a bit of a head scratcher.

In any case, merged in 435d982.

@sds sds closed this May 3, 2015
@jawshooah jawshooah deleted the commit-msg/empty-message branch May 3, 2015 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants