TortoiseGit - change default merge message

本秂侑毒 提交于 2019-12-06 07:25:58

TortoiseGit hooks are fully independent of vanilla Git hooks.

You can use any script language or executable as TortoiseGit hook script. However, in the configuration you have to enter a a valid Windows executable as command, e.g. an .exe file, for .js or .vbs scripts you need to specify the interpreter (wscript or cscript) and the path to the script as the interpreter parameter (cf. here). For executing a bash script I think you need to execute bash.exe with the appropriate parameters to a script - I haven't tested this before.

The executed hook gets some parameters from TortoiseGit, those are documented here, e.g. the Start-commit is called when the commit dialog is opened and gets three cli parameters: PATH MESSAGEFILE CWD, whereas PATH is a path to a file containing all entries of the commit dialog, MESSAGEFILE is the path to a file where you can put the contents to which should be used as commit message and CWD is the working tree path.

Examples can be found on https://github.com/TortoiseGit/TortoiseGit/tree/master/contrib/hook-scripts/client-side

PS: In order to check whether this is a merge commit you can check for the existance of .git/MERGE_HEAD.

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