0

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)...

Community
  • 1
  • 1
Erwin Mayer
  • 18,076
  • 9
  • 88
  • 126
  • possible duplicate of [Mercurial - Empty Commit Message](http://stackoverflow.com/questions/3343424/mercurial-empty-commit-message) – jk. Nov 02 '11 at 13:18
  • and I think it does provide an answer, see mine there for cmd line or for tortoise you will probably have to use patricks. I dont think you should be asking the question again just cos you don't like the answer – jk. Nov 02 '11 at 13:20
  • The answers provided (including Patrick's and yours) did not answer the question of how to completely avoid commit messages, but I do appreciate your contribution. – Erwin Mayer Nov 02 '11 at 16:00
  • 1
    for the command line mine does completely avoid the commit message, for tortoise there is no solution, on reflection this probably means this isn't a dup as this addresses thg while the other addresses hg, but I do disagree with your statement that all the other questions answers say is its bad practice. – jk. Nov 02 '11 at 17:53
  • Thanks jk., I had misunderstood your answer (I thought you suggested an alias to reduce the amount of text to type, but not avoid it completely). I have updated my question accordingly. – Erwin Mayer Nov 03 '11 at 04:16

2 Answers2

2

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

Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
  • Thanks, I may end up implementing this as a policy component for commit messages, along with the minimum length (which already exists). – Erwin Mayer Nov 02 '11 at 16:04
  • I've created an [issue #3337 - Default commit message](https://bitbucket.org/tortoisehg/thg/issue/3337/default-commit-message) for this feature – Robert Važan Aug 26 '13 at 23:40
1

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.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229