In git, I can do “git commit –verbose” to show me a diff right there in the message editor. I don’t see any option for it in mercurial. Is there a mercurial plugin to show me a diff in the message editor or anything similar?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short answer: There is no
git commit --verboseequivalent in mercurial, but it’s possible to hack it in.The edit text is hard-coded in the mercurial source, so no plugin or configuration can directly change it.
The best you can do is to hack the ui.editor setting in your hgrc to add text into the editor directly. I made a script called hg-commit-editor:
and then set it as my commit editor in my hgrc:
This appends the output of “hg diff” to the bottom of the edit text file after a special line (source) so it’s not included as part of the commit message.