Egit钩子不会被触发 [英] Egit hooks do not get triggered
问题描述
cat .git 我有一个git repo,它有一个预先提交的钩子,故意100% / hooks / pre-commit
>退出1
如果我尝试通过命令行提交,它按预期失败。但是,如果我从egit提交,挂钩将被忽略,并且更改将被提交。
egit / jgit是否不识别挂钩?有没有解决这个问题的方法?
在此先感谢!
(原文答案:2011年6月)
MatrixFrog 正确点转到错误299315 ,其中提到这些挂钩不受支持还可以。
您也可以浏览JGit存储库,现在在GitHub上,不显示任何关于钩子的提交。
您可以在 EGit用户指南:钩子的概念也没有提及。
2015年3月更新(4年后):由于 MariuszS 指出在评论中,hook出现在JGit 中。
在2015年,有一些工作正在进行中,以支持这些挂钩: b 这些应该在即将到来的JGit 3.7中b / b 更新2015年第4季度,EGit 4.x支持挂钩,如此答案中所述。 I have a git repo with a pre-commit hook that intentionally fails 100% of the time.
$ b
$ b
cat .git/hooks/pre-commit
> exit 1
If I try to commit through the command line, it fails as expected. However, if I commit from egit, the hook is ignored and the changes get committed.
Does egit/jgit not recognize hooks yet? Is there a workaround for this?
Thanks in advance!
(Original answer: June 2011)
MatrixFrog correctly points out to the bug 299315, which mentions those hooks aren't supported yet.
You also can explore the JGit repository, now on GitHub, which doesn't show any commit about hooks.
And you can search for 'hook' in the EGit User Guide: the notion of hook isn't mentioned either.
Update March 2015 (4 years later): as MariuszS points out in the comments, "hook" is present in JGit.
In 2015, there are works in progress to support those hooks:
- "Introduce hook support into the FS implementations"
- "Support for the pre-commit hook" (so not yet pre-receive hook)
Those should be in the upcoming JGit 3.7
Update Q4 2015, EGit 4.x does support hooks, as mentioned in this answer.
这篇关于Egit钩子不会被触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!