Erwin Mayer
Erwin Mayer

Reputation: 18670

How can I make the commit message optional or a default in TortoiseHG (Mercurial)?

For some reason, I don't need to always include a message when committing with TortoiseHG (and VisualHG).

However, TortoiseHG (following the command line syntax) will not allow it. As it is painful to write a space or a random letter each time, I was wondering if there is a way to include a default commit message (such as "update"), or making this message optional (at least in the GUI), without recompiling TortoiseHG :).

If you know of a solution for TortoiseSVN or TortoiseGit, it probably applies as well for TortoiseHG.

I am aware of Does Mercurial support empty commit messages? but it doesn't provide an answer for TortoiseHG (for the CLI jk.'s answer seems to work). As for "it's bad practice" comments, it is true in many cases but not all (imagine if Dropbox asked you each time anything changes to write a commit message)...

Upvotes: 0

Views: 874

Answers (2)

Martin Geisler
Martin Geisler

Reputation: 73798

You cannot have an empty commit message in Mercurial, it's simply not supported by the file format. Teaching TortoiseHg to use a template is another thing and you can try opening an issue for this.

Upvotes: 1

Benjamin Pollack
Benjamin Pollack

Reputation: 28460

There's no way to do that in the current version of TortoiseHg. You would have to submit a patch upstream, modifying the behavior. You can see this for yourself in the TortoiseHg source code: https://bitbucket.org/tortoisehg/thg/src/0e6a0b894e70/tortoisehg/hgqt/commit.py#cl-670

Upvotes: 2

Related Questions