0

perl で書かれた gitolite3 の構成ファイルを編集したいのですが、次のようになります。

# comments

# comments

%RC = (

    # ------------------------------------------------------------------

    # comments
    UMASK                           =>  0077,

    # comments
    GIT_CONFIG_KEYS                 =>  '',

    # comments
    ROLES => {
        READERS                     =>  1,
        WRITERS                     =>  1,
    },

    # comments
    ENABLE => [

        # comments

            'help',
            'desc',
            'info',
            'perms',
            'writable',

        # comments

    ],

);

# ------------------------------------------------------------------------------
# comments
1;

# comments

augeas が利用できない場合は、コメントを保持する何かが必要です。コメントは、私と将来の管理者にとって非常に便利です。

4

1 に答える 1

2

gitolite.rc は連想配列であるため、perl でユーティリティを作成することを検討できます。

src/lib/Gitolite/Rc.pmそのファイルをロードする方法をすでに示しており、キー/値を照会する方法を提供します

Usage: gitolite query-rc -a
gitolite query-rc [-n] [-q] rc-variable
-a print all variables and values (first level only)
-n do not append a newline if variable is scalar
-q exit code only (shell truth; 0 is success)

ただし、キー/値を追加して構成を書き戻す方法でこれらの機能を拡張できます。

于 2014-10-22T08:13:29.420 に答える