Is there a way to configure Mercurial to allow for empty commit messages? If you try hg commit
through the CLI without entering a commit message, the commit is canceled with: abort: empty commit message
.
Now, I know that committing without a message is usually considered bad form, but does Mercurial allow it at all?
git generally requires a non-empty message because providing a meaningful commit message is part of good development practice and good repository stewardship.
If you are still in the draft phase (not pushed elsewhere yet), use the built-in extension hg strip <rev> command. Otherwise, you should do a hg backout , which will reverse the changeset. In case you still need the commit you made, I suggest you export it to import it again in the correct branch, before stripping.
You can use just a space, but I'd really discourage it:
hg commit -m " "
If the problem is that you don't want to enter the -m "blah" part you can always set up an alias. e.g. in hgrc
[alias]
qcommit = commit -m "quick commit - no message"
If you don't like qcommit then you can alias to commit instead i.e.
[alias]
commit = commit -m "quick commit - no message"
this won't help you with TortoiseHG however which presumebly validates its entry fields before passing data to mercurial iteslf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With