[英]TortoiseGit Git Commit message from script
I have generated Start Commit Hook in TortoiseGit which calls StartComit.bat file and option "Wait for the script to finish" is enabled. 我在TortoiseGit中生成了Start Commit Hook,它调用了StartComit.bat文件并启用了“等待脚本完成”选项。
The content of the bat file is bat文件的内容是
echo "Some more info...." >> %1
The script is getting called before Commit dialog opens but it's not working, I'm not getting any text in Message field. 在提交对话框打开之前调用脚本,但它不起作用,我没有在Message字段中获取任何文本。
What am I doing wrong here? 我在这做错了什么?
Edit: Just to make question more clear I'm trying to fallow this accepted answer https://stackoverflow.com/a/3967136/596935 and do a similar thing. 编辑:只是为了让问题更清楚我试图让这个接受的答案https://stackoverflow.com/a/3967136/596935做一个类似的事情。
%1 is the path to a file containing all selected files when starting the commit dialog and not the path to the file for the message which is %2. %1是启动提交对话框时包含所有选定文件的文件的路径,而不是%2消息的文件路径。
See https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks for a manual regarding the parameters. 有关参数的手册,请参阅https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks 。
Thus, 从而,
echo Some more info.... >> %2
should solve this issue. 应该解决这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.