git 如何在 Gitolite 配置中为存储库添加描述

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13015001/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 07:40:22  来源:igfitidea点击:

How to add description for a repository in Gitolite configuration

gitrepositorygitolite

提问by arulraj.net

I am using gitolite for user maintenance for my GIT server. Everything works fine except repo description. I have setup the description for a repo like "reponame = repo description" in gitolite.conf. Earlier version (before v3.x) its working. Now its not working. For your information I am using

我正在使用 gitolite 为我的 GIT 服务器进行用户维护。除了 repo 描述外,一切正常。我已经在 gitolite.conf 中设置了像“reponame = repo description”这样的 repo 的描述。早期版本(v3.x 之前)可以正常工作。现在它不工作。为了您的信息,我正在使用

  • gitolite v3.1
  • GIT v1.7.1
  • Perl v5.10.1
  • gitolite v3.1
  • git v1.7.1
  • Perl v5.10.1

Here is my gitolite.conf file http://pastebin.com/DYCK3uRLor http://arulraj.net/gitolite.conf. The post-receive-email mail subject and signature not have description because of that repo description file not generated automatically using gitolite. How can I fix this..?

这是我的 gitolite.conf 文件http://pastebin.com/DYCK3uRLhttp://arulraj.net/gitolite.conf。post-receive-email 邮件主题和签名没有描述,因为 repo 描述文件不是使用 gitolite 自动生成的。我怎样才能解决这个问题..?

回答by arulraj.net

I am happy to say its fixed now. I added this https://github.com/sitaramc/gitolite/blob/master/src/triggers/post-compile/update-description-filescript in gitolite post_compile section.

我很高兴地说它现在已经修复了。我在 gitolite post_compile 部分添加了这个https://github.com/sitaramc/gitolite/blob/master/src/triggers/post-compile/update-description-file脚本。

1.Open the .gitolite.rcfile in HOME directory and edit post_compile section.

1.打开HOME目录下的.gitolite.rc文件,编辑post_compile部分。

    POST_COMPILE                =>
    [
        'post-compile/ssh-authkeys',
        'post-compile/update-git-configs',
        'post-compile/update-gitweb-access-list',
        'post-compile/update-git-daemon-access-list',
        'post-compile/update-description-file',
    ],

2.Then add description for repo in gitolite.conf. Please refer the below

2.然后在gitolite.conf中添加repo的描述。请参考以下

repo    testing
RW+     =   @all
desc = "GIT testing"

3.Then commit and push your changes.

3.然后提交并推送您的更改。

Now the description is automatically created. My new conf file here http://pastebin.com/c8Ggfbdior http://arulraj.net/gitolite.conf.new.

现在描述是自动创建的。我的新 conf 文件在这里http://pastebin.com/c8Ggfbdihttp://arulraj.net/gitolite.conf.new

回答by schnell18

As of gitolite 3.5, you don't have to put the POST_COMPILEstuff. Just as enable the "cgit"option with ENABLE => [ 'cgit' ]. And you run the gitolite setup, then the .git/descriptionfiles will be created with value from gitweb.descriptionoption.

从 gitolite 3.5 开始,您不必放置这些POST_COMPILE东西。就像启用"cgit"选项一样ENABLE => [ 'cgit' ]。然后您运行 gitolite 设置,然后.git/description将使用gitweb.description选项中的值创建文件。

回答by Pierre de LESPINAY

From adding a description to repos you created

添加描述到您创建的存储库

ssh git@host desc -h

Watch out the WRITER_CAN_UPDATE_DESCsettingto avoid the "FATAL: you are not authorized" error.

注意WRITER_CAN_UPDATE_DESC设置以避免“致命:您未被授权”错误。