5 use lib
$ENV{GL_LIBDIR
};
8 # README.html files work similar to "description" files. For further
10 # https://www.kernel.org/pub/software/scm/git/docs/gitweb.html
11 # under "Per-repository gitweb configuration".
14 Usage: ssh git@host readme <repo>
15 ssh git@host readme <repo> rm
16 cat <filename> | ssh git@host readme <repo> set
18 Show, remove or set the README.html file for repo.
20 You need to have write access to the repo and the 'writer-is-owner' option
21 must be set for the repo, or it must be a user-created ('wild') repo and you
25 usage
() if not @ARGV or @ARGV < 1 or $ARGV[0] eq '-h';
29 usage
() if $op and $op ne 'rm' and $op ne 'set';
30 my $file = 'README.html';
33 _die
"you are not authorized" unless
34 ( not $op and can_read
($repo) ) or
35 ( $op and owns
($repo) ) or
36 ( $op and can_write
($repo) and option
( $repo, 'writer-is-owner' ) );
40 unlink "$rc{GL_REPO_BASE}/$repo.git/$file";
41 } elsif ( $op eq 'set' ) {
42 textfile
( file
=> $file, repo
=> $repo, prompt
=> '' );
44 print textfile
( file
=> $file, repo
=> $repo );
49 The WRITER_CAN_UPDATE_README option is gone now
; it applies to all the repos
50 in the
system. Much better to add
'option writer-is-owner = 1' to repos
or
51 repo groups that you want this to apply to
.
53 This option is meant to cover desc
, readme
, and any other repo
-specific text
54 file
, so it
's also a blunt instrument, though in a different dimension :-)