Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Mercurial support empty commit messages?

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?

like image 451
derekerdmann Avatar asked Jul 27 '10 12:07

derekerdmann


People also ask

Can you commit with no message?

git generally requires a non-empty message because providing a meaningful commit message is part of good development practice and good repository stewardship.

How can I delete last commit in Mercurial?

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.


2 Answers

You can use just a space, but I'd really discourage it:

hg commit -m " "
like image 135
PatrickSteele Avatar answered Oct 16 '22 09:10

PatrickSteele


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

like image 4
jk. Avatar answered Oct 16 '22 07:10

jk.