1

我有一个类似的配置文件:

repo qt/[a-zA-Z0-9_\.\-]+
  C      = @admins
  RW+    = @admins
  R      = @users
  RW bob = bob

正如您所看到的,每个用户(在@users 组中)都可以读取所有分支,我希望 bob 能够创建并推送到分支 bob(以及 bob/fix 等)。

是否有可以扩展到用户名的宏?我想做类似的事情:

repo qt/[a-zA-Z0-9_\.\-]+
  C       = @admins
  RW+     = @admins
  R       = @users
  RW USER = USER
4

1 回答 1

2

一个看起来接近你想要的 Gitolite 功能是“个人分支

“个人”分支非常适合开发人员需要共享工作但不能直接相互拉取的环境(通常是由于网络或身份验证相关的原因,这在公司设置中都很常见)。

个人分支存在于它们自己的命名空间中。语法是

RW+ personal/USER/  =   @userlist

where the "personal" can be anything you like (but cannot be empty), and the "/USER/" part is necessary (including both slashes).

A user "alice" (if she's in the userlist) can then push any branches inside personal/alice/.
Which means she can push personal/alice/foo and personal/alice/bar, but NOT personal/alice.

(Background: at runtime the "USER" component will be replaced by the name of the invoking user. Access is determined by the right hand side, as usual).

That means, when you are looking for "Is there a macro that would expand to the users name?", /USER/ would be an example of a "macro" expended to the username.

于 2012-05-18T12:11:21.983 回答