Does Mercurial support empty commit messages?

房东的猫 提交于 2019-12-30 02:45:08

问题


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?


回答1:


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

hg commit -m " "



回答2:


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



来源:https://stackoverflow.com/questions/3343424/does-mercurial-support-empty-commit-messages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!