来自脚本的TortoiseGit Git提交消息 [英] TortoiseGit Git Commit message from script

查看:221
本文介绍了来自脚本的TortoiseGit Git提交消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在TortoiseGit中生成了Start Commit Hook,它调用了 StartComit.bat 文件,并且启用了等待脚本完成"选项..

bat文件的内容是

echo "Some more info...." >> %1

该脚本在之前之前被调用,但提交"对话框打开,但是它不起作用,消息"字段中没有任何文本.

我在做什么错了?

只是为了使问题更清楚,我正在尝试放弃这个已接受的答案 https://stackoverflow.com/a/3967136/596935 并做类似的事情.

解决方案

%1是启动提交对话框时包含所有选定文件的文件的路径,而不是消息%2的文件的路径./p>

请参见 https://tortoisegit.org/docs/tortoisegit/tgit-dug-settings.html#tgit-dug-settings-hooks 以获得有关参数的手册.

因此

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

应该解决这个问题.

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

这篇关于来自脚本的TortoiseGit Git提交消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆