2 # ABSTRACT: A tool for managing CODEOWNERS files
3 # PODNAME: git-codeowners
6 # FATPACK - Do not remove this line.
13 our $VERSION = '0.41'; # VERSION
15 App::Codeowners->main(@ARGV);
25 git-codeowners - A tool for managing CODEOWNERS files
33 git-codeowners [--version|--help|--manual]
35 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
37 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
39 git-codeowners patterns [--format FORMAT] [--owner OWNER]
41 git-codeowners create|update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
43 # enable bash shell completion
44 eval "$(git-codeowners --shell-completion)"
48 F<git-codeowners> is yet another CLI tool for managing F<CODEOWNERS> files in git repos. In
49 particular, it can be used to quickly find out who owns a particular file in a monorepo (or
52 B<THIS IS EXPERIMENTAL!> The interface of this tool and its modules will probably change as I field
53 test some things. Feedback welcome.
57 There are several ways to install F<git-codeowners> to your system.
61 You can install F<git-codeowners> using L<cpanm>:
67 You can also choose to download F<git-codeowners> as a self-contained executable:
69 curl -OL https://raw.githubusercontent.com/chazmcgarvey/git-codeowners/solo/git-codeowners
70 chmod +x git-codeowners
72 To hack on the code, clone the repo instead:
74 git clone https://github.com/chazmcgarvey/git-codeowners.git
76 make bootstrap # installs dependencies; requires cpanm
82 Print the program name and version to C<STDOUT>, and exit.
88 Print the synopsis to C<STDOUT>, and exit.
92 You can also use C<--manual> to print the full documentation.
96 Enable colorized output.
98 Color is ON by default on terminals; use C<--no-color> to disable. Some environment variables may
99 also alter the behavior of colorizing output:
105 C<NO_COLOR> - Set to disable color (same as C<--no-color>).
109 C<COLOR_DEPTH> - Set the number of supportable colors (e.g. 0, 16, 256, 16777216).
115 Specify the output format to use. See L</FORMAT>.
119 =head2 --shell-completion
121 eval "$(lintany --shell-completion)"
123 Print shell code to enable completion to C<STDOUT>, and exit.
125 Does not yet support Zsh...
131 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
133 Show owners of one or more files in a repo.
137 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
141 git-codeowners patterns [--format FORMAT] [--owner OWNER]
145 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
147 Create a new F<CODEOWNERS> file for a specified repo (or current directory).
151 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
153 Update the "unowned" list of an existing F<CODEOWNERS> file for a specified
154 repo (or current directory).
158 The C<--format> argument can be one of:
164 C<csv> - Comma-separated values (requires L<Text::CSV>)
168 C<json:pretty> - Pretty JSON (requires L<JSON::MaybeXS>)
172 C<json> - JSON (requires L<JSON::MaybeXS>)
176 C<table> - Table (requires L<Text::Table::Any>)
180 C<tsv> - Tab-separated values (requires L<Text::CSV>)
184 C<yaml> - YAML (requires L<YAML>)
188 C<FORMAT> - Custom format (see below)
194 You can specify a custom format using printf-like format sequences. These are the items that can be
205 C<%O> - Owner or owners
229 The syntax also allows padding and some filters. Examples:
231 git-codeowners show -f ' * %-50F %O' # default for "show"
232 git-codeowners show -f '%{quote}F,%{quote}O' # ad hoc CSV
233 git-codeowners patterns -f '--> %{color:0c0}T' # whatever...
241 C<quote> - Quote the replacement string.
245 C<color:FFFFFF> - Colorize the replacement string (if color is ON).
249 C<nocolor> - Do not colorize replacement string.
255 Table formatting can be done by one of several different modules, each with its own features and
256 bugs. The default module is L<Text::Table::Tiny>, but this can be overridden using the
257 C<PERL_TEXT_TABLE> environment variable if desired, like this:
259 PERL_TEXT_TABLE=Text::Table::HTML git-codeowners -f table
261 The list of available modules is at L<Text::Table::Any/@BACKENDS>.
265 Please report any bugs or feature requests on the bugtracker website
266 L<https://github.com/chazmcgarvey/git-codeowners/issues>
268 When submitting a bug or request, please include a test-file or a
269 patch to an existing test-file that illustrates the bug or desired
274 Charles McGarvey <chazmcgarvey@brokenzipper.com>
276 =head1 COPYRIGHT AND LICENSE
278 This software is copyright (c) 2019 by Charles McGarvey.
280 This is free software; you can redistribute it and/or modify it under
281 the same terms as the Perl 5 programming language system itself.