gpt4 book ai didi

svn - 如何防止 Subversion 在没有注释的情况下提交?

转载 作者:行者123 更新时间:2023-12-02 23:49:38 24 4
gpt4 key购买 nike

有人知道在没有输入提交注释的情况下如何防止提交到 Subversion 代码存储库吗?

最佳答案

您可以使用钩子(Hook)(将其放入 <repository>/hooks 并将其命名为 pre-commit.bat (Windows)):

@echo off
::
:: Stops commits that have empty log messages.
::

setlocal

rem Subversion sends through the path to the repository and transaction id
set REPOS=%1
set TXN=%2

rem check for an empty log message
svnlook log %REPOS% -t %TXN% | findstr . > nul
if %errorlevel% gtr 0 (goto err) else exit 0

:err
echo. 1>&2
echo Your commit has been blocked because you didn't give any log message 1>&2
echo Please write a log message describing the purpose of your changes and 1>&2
echo then try committing again. -- Thank you 1>&2
exit 1

源代码:http://www.anujgakhar.com/2008/02/14/how-to-force-comments-on-svn-commit/

关于svn - 如何防止 Subversion 在没有注释的情况下提交?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1928023/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com