17
17
-q exit code only (shell truth; 0 is success)
18
18
-n suppress trailing newline when used as key (not pattern)
19
19
-r treat key as regex pattern (unanchored)
20
-ev print keys with empty values also (see below)
22
23
gitolite git-config repo gitweb.owner
23
24
gitolite git-config -q repo gitweb.owner
24
25
gitolite git-config -r repo gitweb
26
When the key is treated as a pattern, prints:
28
reponame<tab>key<tab>value<newline>
30
Otherwise the output is just the value.
32
Finally, see the advanced use section of 'gitolite access -h' -- you can do
33
something similar here also:
35
gitolite list-phy-repos | gitolite git-config -r % gitweb\\. | cut -f1 > ~/projects.list
29
1. When the key is treated as a pattern, prints:
31
reponame<tab>key<tab>value<newline>
33
Otherwise the output is just the value.
35
2. By default, keys with empty values (specified as "" in the conf file) are
36
treated as non-existant. Using '-ev' will print those keys also. Note
37
that this only makes sense when the key is treated as a pattern, where
38
such keys are printed as:
40
reponame<tab>key<tab><newline>
42
3. Finally, see the advanced use section of 'gitolite access -h' -- you can
43
do something similar here also:
45
gitolite list-phy-repos | gitolite git-config -r % gitweb\\. | cut -f1 > ~/projects.list
38
48
usage() if not @ARGV;
40
my ( $help, $nonl, $quiet, $regex ) = (0) x 4;
50
my ( $help, $nonl, $quiet, $regex, $ev ) = (0) x 5;
48
59
my ( $repo, $key ) = @ARGV;
54
65
# single repo, single key; no STDIN
55
66
$key = "^\Q$key\E\$" unless $regex;
57
$ret = git_config( $repo, $key );
68
$ret = git_config( $repo, $key, $ev );
59
70
# if the key is not a regex, it should match at most one item
60
71
_die "found more than one entry for '$key'" if not $regex and scalar( keys %$ret ) > 1;
80
91
my $r = $repo || shift @in;
81
92
my $k = $key || shift @in;
82
93
$k = "^\Q$k\E\$" unless $regex;
83
$ret = git_config( $r, $k );
94
$ret = git_config( $r, $k, $ev );
85
96
map { print "$r\t$_\t" . $ret->{$_} . "\n" } sort keys %$ret;