TortoiseGit Git Commit message from script

让人想犯罪 __ 提交于 2019-12-12 14:23:20

问题


I have generated Start Commit Hook in TortoiseGit which calls StartComit.bat file and option "Wait for the script to finish" is enabled.

The content of the bat file is

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.

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.


回答1:


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

See https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks for a manual regarding the parameters.

Thus,

echo Some more info.... >> %2

should solve this issue.



来源:https://stackoverflow.com/questions/38371758/tortoisegit-git-commit-message-from-script

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