Egit钩子不会被触发

编程入门 行业动态 更新时间:2024-10-28 13:16:03
本文介绍了Egit钩子不会被触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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 $ b

  • 在FS实现中引入钩子支持
  • 支持预提交钩子(所以还没有预先接收钩子)
  • 这些应该在即将到来的JGit 3.7中b / b $ b

    更新2015年第4季度,EGit 4.x支持挂钩,如此答案中所述。

    I have a git repo with a pre-commit hook that intentionally fails 100% of the time.

    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钩子不会被触发

本文发布于:2023-10-13 14:36:31,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:钩子   Egit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!