2 # ABSTRACT: A tool for managing CODEOWNERS files
3 # PODNAME: git-codeowners
7 git-codeowners [--version|--help|--manual]
9 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
11 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
13 git-codeowners patterns [--format FORMAT] [--owner OWNER]
15 git-codeowners create|update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
17 # enable bash shell completion
18 eval "$(git-codeowners --shell-completion)"
22 F<git-codeowners> is yet another CLI tool for managing F<CODEOWNERS> files in git repos. In
23 particular, it can be used to quickly find out who owns a particular file in a monorepo (or
26 B<THIS IS EXPERIMENTAL!> The interface of this tool and its modules will probably change as I field
27 test some things. Feedback welcome.
31 There are several ways to install F<git-codeowners> to your system.
35 You can install F<git-codeowners> using L<cpanm>:
41 You can also choose to download F<git-codeowners> as a self-contained executable:
43 curl -OL https://raw.githubusercontent.com/chazmcgarvey/git-codeowners/solo/git-codeowners
44 chmod +x git-codeowners
46 To hack on the code, clone the repo instead:
48 git clone https://github.com/chazmcgarvey/git-codeowners.git
50 make bootstrap # installs dependencies; requires cpanm
56 Print the program name and version to C<STDOUT>, and exit.
62 Print the synopsis to C<STDOUT>, and exit.
66 You can also use C<--manual> to print the full documentation.
70 Enable colorized output.
72 Color is ON by default on terminals; use C<--no-color> to disable. Some environment variables may
73 also alter the behavior of colorizing output:
76 * C<NO_COLOR> - Set to disable color (same as C<--no-color>).
77 * C<COLOR_DEPTH> - Set the number of supportable colors (e.g. 0, 16, 256, 16777216).
81 Specify the output format to use. See L</FORMAT>.
85 =head2 --shell-completion
87 eval "$(lintany --shell-completion)"
89 Print shell code to enable completion to C<STDOUT>, and exit.
91 Does not yet support Zsh...
97 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
99 Show owners of one or more files in a repo.
103 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
107 git-codeowners patterns [--format FORMAT] [--owner OWNER]
111 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
113 Create a new F<CODEOWNERS> file for a specified repo (or current directory).
117 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
119 Update the "unowned" list of an existing F<CODEOWNERS> file for a specified
120 repo (or current directory).
124 The C<--format> argument can be one of:
127 * C<csv> - Comma-separated values (requires L<Text::CSV>)
128 * C<json:pretty> - Pretty JSON (requires L<JSON::MaybeXS>)
129 * C<json> - JSON (requires L<JSON::MaybeXS>)
130 * C<table> - Table (requires L<Text::Table::Any>)
131 * C<tsv> - Tab-separated values (requires L<Text::CSV>)
132 * C<yaml> - YAML (requires L<YAML>)
133 * C<FORMAT> - Custom format (see below)
137 You can specify a custom format using printf-like format sequences. These are the items that can be
142 * C<%O> - Owner or owners
147 * C<%%> - percent sign
149 The syntax also allows padding and some filters. Examples:
151 git-codeowners show -f ' * %-50F %O' # default for "show"
152 git-codeowners show -f '%{quote}F,%{quote}O' # ad hoc CSV
153 git-codeowners patterns -f '--> %{color:0c0}T' # whatever...
158 * C<quote> - Quote the replacement string.
159 * C<color:FFFFFF> - Colorize the replacement string (if color is ON).
160 * C<nocolor> - Do not colorize replacement string.
164 Table formatting can be done by one of several different modules, each with its own features and
165 bugs. The default module is L<Text::Table::Tiny>, but this can be overridden using the
166 C<PERL_TEXT_TABLE> environment variable if desired, like this:
168 PERL_TEXT_TABLE=Text::Table::HTML git-codeowners -f table
170 The list of available modules is at L<Text::Table::Any/@BACKENDS>.
174 # FATPACK - Do not remove this line.
181 our $VERSION = '9999.999'; # VERSION
183 App::Codeowners->main(@ARGV);