【问题标题】:How can you restrict Gitolite VREF restrictions to only one branch?如何将 Gitolite VREF 限制限制在一个分支上?
【发布时间】:2014-10-09 11:01:20
【问题描述】:

除了将更改推送到此处的同步用户之外,没有人应该能够写入存储库中的 profiles/recruiter 目录:

repo    test
    RW                                = @contributors gitsync
    RW  VREF/NAME/profiles/recruiter/ = gitsync
    -   VREF/NAME/profiles/recruiter/ = @all

到目前为止,这有效。现在我只想对 master 分支进行限制,以便贡献者可以将任何东西推送到功能分支。但这不起作用:

repo    test
    RW                                       = @contributors gitsync
    RW  master VREF/NAME/profiles/recruiter/ = gitsync
    -   master VREF/NAME/profiles/recruiter/ = @all

即使我将 master 添加到第一条规则,它也不起作用:

repo    test
        RW                                      = @contributors
        RW  master                              = @contributors
        RW  master VREF/NAME/profiles/recruiter/ = klausi
        -   master VREF/NAME/profiles/recruiter/ = klausi_test

然后不允许 klausi_test 用户将 profile/recruiter 目录中的内容推送到某个 foobar 分支。

我也试过 gitolite disallow access for directory on master branch but not on user branch ,但也没有用。有什么提示吗?

【问题讨论】:

  • 但在我的回答stackoverflow.com/a/11900083/6309 中,我还在第一条规则中添加了masterRW master = @contributors gitsync。您可以尝试在第一条规则中添加master 吗?
  • 即使我将 master 添加到第一条规则它也不起作用。
  • 你用的是什么版本的gitolite?
  • 也许更新到最新版本将有助于更多地了解 VREF 无法正常工作的原因,因为 github.com/sitaramc/gitolite/commit/…(我刚刚仔细查看,这只是为了添加信息消息,所以不是对你的情况很有帮助)
  • 访问命令虽然可以提供帮助:github.com/sitaramc/gitolite/blob/…

标签: gitolite


【解决方案1】:

我最近不得不想出类似的东西,我想我想出了如何使用refex-expr 功能。我相信这是 3.6.2 中的一个功能。以下设置应该可以工作。

repo test
    RW                                           = @contributors gitsync
    RW  master                                   = @contributors
    RW  VREF/NAME/profiles/recruiter/            = @contributors
    -   master and VREF/NAME/profiles/recruiter/ = @contributors

请注意,您需要在 .gitolite.rc 文件中启用 refex-expr 功能。

【讨论】:

    猜你喜欢
    • 2015-07-02
    • 1970-01-01
    • 2015-11-02
    • 1970-01-01
    • 2017-05-04
    • 2011-07-17
    • 2012-06-02
    • 2014-06-27
    • 1970-01-01
    相关资源
    最近更新 更多