问题标签 [post-commit-hook]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
16 回答
76901 浏览

svn - 如何让 Subversion (SVN) 在签到时发送电子邮件?

我一直发现签入(提交)邮件对于跟踪其他人在代码库/存储库中所做的工作非常有用。如何设置 SVN 以在每次提交时通过电子邮件发送分发列表?

我在 Windows 上运行客户端,在 Linux 上运行 Apache Subversion 服务器。不过,下面针对各种平台的答案可能对其他人有用。

0 投票
1 回答
1735 浏览

svn - svn post-commit 脚本从命令行运行,但在将文件提交到 svn 时不运行

我在 svn 中有一个 post-commit 钩子,当我运行时从命令行运行良好

但是当从 svn 调用脚本时,它似乎不起作用。

我基本上做的是检查提交的文件,如果修改了特定文件,我会将它的 svn 导出到网络共享。从命令行工作正常。

提交后脚本如下:

有没有办法在脚本运行时将任何错误消息输出到文件,或者特别是 svn export 行(我认为可能存在问题)?

0 投票
1 回答
772 浏览

client - 如何在 Riak 中实现提交前和提交后挂钩?

除了这篇博客文章和其他一些文章之外,关于如何实际实现Riak 的这些功能的信息很少。是否有任何客户端库(波纹等)能够通过钩子接收消息,以便使用应用程序(即在 Riak 之外)中更改的数据成为可能?谢谢。

0 投票
3 回答
5225 浏览

svn - SVN post commit:提交的用户是谁?

在 SVN 提交后挂钩中,如何获取执行提交的用户?

0 投票
1 回答
256 浏览

svn - 如果当前修订版正在创建分支/标签,如何在 post-commit-hook 中找出?

如果当前提交正在创建新标签,我想编写一个仅触发的提交后挂钩。标签被复制到 /tags/*new_tag_name*/ 目录。我的动机是,如果提交正在创建一个新标签,则应该在我的 Web 根目录中签出新标签。

如何在提交后脚本中执行此操作,我只有 svn 名称和修订号作为函数参数?

0 投票
1 回答
1178 浏览

git - Git Post Commit Hook 获取提交号

我正在努力让我的 post-commit 挂钩更改文件以获取提交号,以便我的应用程序可以在错误处理中使用它。

我能够构建 perl 脚本来更改文件,但我想知道如何从钩子中获取提交 ID。目前我的钩子看起来像这样:

我希望提交编号是某种保存提交 ID 的变量。

编辑:我发现这git rev-parse HEAD将生成我需要的 HEAD 提交,但我不知道如何在命令中使用它。

0 投票
1 回答
5495 浏览

rsync - Visual SVN Server: Guide on Pre/Post Commit Hooks

This may be best as a wiki, given comments on here: Share common / useful SVN pre-commit hooks

I'm using Visual SVN 2.1.7 on a Windows 7 machine. We have developers committing from various countries and we can manage the code changes by running local copies of the changes and then uploading manually via ftp to the server for each website that's being worked on.

This is an incredibly time consuming process, but less time-consuming than fixing bugs on live sites, so it's a step in the right direction.

On the Visual SVN website it makes a mention of post-commit and pre-commit hooks but fails to show where that can be accessed, even though it mentions there is a GUI. There's no sign of a GUI or even an option in the installed version, so I can't locate, firstly, where to access it.

Assuming it can be done via scripting, I have googled and come to SO to look for some guidance on where it might be and how it might be done, but it seems to be a lot more complicated than I'd hoped.

Does anyone have any experience or guidance, including sample scripts, for how to perform the following tasks on Windows (without perl installed)?

a) Create a pre-commit command/file and attach its execution to a repository/commits to it b) Create a post-commit command/file and attach its execution to a repository/commits to it

and in my case, one specific task: c) How to have a local Visual SVN installation on a PC that can send committed files to remote CentOS shared hosted server (not VPS/Dedi or Cloud hosted and SVN can't be installed on those machines)

It's a great piece of software but it seems like the barrier is quite high to being efficient with it because it's unclear what questions you need to ask or where to look. Hopefully, you can help provide a better starting point for those stuck in the same way.

Thanks :)

0 投票
2 回答
7406 浏览

php - 为什么我会收到此错误:提交后挂钩失败(退出代码 255),没有输出

提交到存储库时出现以下错误:

提交后代码如下:

  • 正如你所看到的,有大量的错误日志,但错误日志永远不会被填充(除非我输入了一个明显的错误,比如缺少路径)
  • 开发环境和实时环境都是 Windows
  • 似乎出现错误的那一行是最后一行——调用 PHP 的地方。当我把它拿出来时,提交工作没有问题
  • 当我在命令行上手动运行它时,它可以工作并且不显示任何(明显的)错误。Afaik svn 默认用户在 SYSTEM 下运行,该用户的权限足够高,不必担心

您可能已经知道,这是将我的 SVN 签入与 Mantis 错误跟踪器连接起来。有趣的是,PHP 脚本正在执行,即注释被添加到错误中并且问题的自动关闭正在工作。它似乎只是出于某种原因出错。

我正在使用 TortoiseSVN 提交,但使用命令行 (SlikSVN) 我得到相同的输出:

Mantis 的 checkin.php 看起来像这样(为了便于阅读,删除了一些一般性注释):

0 投票
1 回答
235 浏览

svn - Subversion 提交后失败!

我刚刚启动了颠覆,但我的 post-commit.tmpl 失败了。

我想在每次主干提交时更新我的​​实时目录,所以我总是可以看到新的工作代码。虽然这似乎在我通过 ssh 更新午餐时有效,但在模板文件中却没有。

这就是我在 post-commit.tmpl 中得到的:

此外,我在日志中一无所获。

我已经更改了对我的网络服务器用户(www-data)和 chmod 777 的目录的所有权限。

我究竟做错了什么?

0 投票
1 回答
971 浏览

windows - 在 Windows Server 中发布提交电子邮件

我目前正在做一个需要在 Windows 上使用 SVN 的项目。我热衷于设置一个提交后挂钩,以便将代码库的任何更改通过电子邮件发送给存储库已更改的所有相关用户。

在 Linux 中运行提交后挂钩非常简单,并且有据可查,但我正在努力寻找在 Windows 服务器上执行此操作的良好指南。

有没有人有解决这个问题的指南的链接,或者有一组我可以传递给我们的服务器团队来设置的步骤?