简体   繁体   English

来自脚本的TortoiseGit Git Commit消息

[英]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.

相关问题 GIT提交到错误的分支-TortoiseGit解决方案 - GIT commit to the wrong branch - TortoiseGit solution 从分支名称解析票证编号,并将其显示为Windows上TortoiseGit中的默认提交消息 - Parse ticket number from branch name and show it as default commit message in TortoiseGit on Windows Git for Windows 更改提交消息? - Git for Windows changes commit message? 无法使用TortoiseGit从ubuntu服务器克隆git repo - Cannot clone git repo from ubuntu server with TortoiseGit 在添加的行中搜索 TODO 并将它们显示为 Windows 上 TortoiseGit 中的默认提交消息 - Search for TODO in added lines and show them as default commit message in TortoiseGit on Windows 如何在Windows和跨平台的npm脚本中为git commit消息传递当前日期时间? - How to pass current datetime in npm script for git commit message in Windows and cross platform? git commit之后的PHP CLI脚本错误 - PHP CLI script errors after git commit 是否可以使用--no-verify标志在TortoiseGit中提交? - Is it possible to commit in TortoiseGit with --no-verify flag? 为什么 Git 在提交消息的底部打印不正确的差异? - Why does Git prints an incorrect diff at the bottom of a commit message? 使用git和tortoisegit在Windows XP上验证失败 - Auth fails on Windows XP with git and tortoisegit
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM