3 git-codeowners - A tool for managing CODEOWNERS files
11 git-codeowners [--version|--help|--manual]
13 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
15 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
17 git-codeowners patterns [--format FORMAT] [--owner OWNER]
19 git-codeowners create|update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
21 # enable bash shell completion
22 eval "$(git-codeowners --shell-completion)"
26 `git-codeowners` is yet another CLI tool for managing `CODEOWNERS` files in git repos. In
27 particular, it can be used to quickly find out who owns a particular file in a monorepo (or
30 **THIS IS EXPERIMENTAL!** The interface of this tool and its modules will probably change as I field
31 test some things. Feedback welcome.
35 There are several ways to install `git-codeowners` to your system.
39 You can install `git-codeowners` using [cpanm](https://metacpan.org/pod/cpanm):
45 You can also choose to download `git-codeowners` as a self-contained executable:
47 curl -OL https://raw.githubusercontent.com/chazmcgarvey/git-codeowners/solo/git-codeowners
48 chmod +x git-codeowners
50 To hack on the code, clone the repo instead:
52 git clone https://github.com/chazmcgarvey/git-codeowners.git
54 make bootstrap # installs dependencies; requires cpanm
60 Print the program name and version to `STDOUT`, and exit.
66 Print the synopsis to `STDOUT`, and exit.
70 You can also use `--manual` to print the full documentation.
74 Enable colorized output.
76 Color is ON by default on terminals; use `--no-color` to disable. Some environment variables may
77 also alter the behavior of colorizing output:
79 - `NO_COLOR` - Set to disable color (same as `--no-color`).
80 - `COLOR_DEPTH` - Set the number of supportable colors (e.g. 0, 16, 256, 16777216).
84 Specify the output format to use. See ["FORMAT"](#format).
90 eval "$(lintany --shell-completion)"
92 Print shell code to enable completion to `STDOUT`, and exit.
94 Does not yet support Zsh...
100 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
102 Show owners of one or more files in a repo.
106 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
110 git-codeowners patterns [--format FORMAT] [--owner OWNER]
114 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
116 Create a new `CODEOWNERS` file for a specified repo (or current directory).
120 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
122 Update the "unowned" list of an existing `CODEOWNERS` file for a specified
123 repo (or current directory).
127 The `--format` argument can be one of:
129 - `csv` - Comma-separated values (requires [Text::CSV](https://metacpan.org/pod/Text%3A%3ACSV))
130 - `json:pretty` - Pretty JSON (requires [JSON::MaybeXS](https://metacpan.org/pod/JSON%3A%3AMaybeXS))
131 - `json` - JSON (requires [JSON::MaybeXS](https://metacpan.org/pod/JSON%3A%3AMaybeXS))
132 - `table` - Table (requires [Text::Table::Any](https://metacpan.org/pod/Text%3A%3ATable%3A%3AAny))
133 - `tsv` - Tab-separated values (requires [Text::CSV](https://metacpan.org/pod/Text%3A%3ACSV))
134 - `yaml` - YAML (requires [YAML](https://metacpan.org/pod/YAML))
135 - `FORMAT` - Custom format (see below)
139 You can specify a custom format using printf-like format sequences. These are the items that can be
143 - `%O` - Owner or owners
148 - `%%` - percent sign
150 The syntax also allows padding and some filters. Examples:
152 git-codeowners show -f ' * %-50F %O' # default for "show"
153 git-codeowners show -f '%{quote}F,%{quote}O' # ad hoc CSV
154 git-codeowners patterns -f '--> %{color:0c0}T' # whatever...
158 - `quote` - Quote the replacement string.
159 - `color:FFFFFF` - Colorize the replacement string (if color is ON).
160 - `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 [Text::Table::Tiny](https://metacpan.org/pod/Text%3A%3ATable%3A%3ATiny), but this can be overridden using the
166 `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 ["@BACKENDS" in Text::Table::Any](https://metacpan.org/pod/Text%3A%3ATable%3A%3AAny#BACKENDS).
174 Please report any bugs or feature requests on the bugtracker website
175 [https://github.com/chazmcgarvey/git-codeowners/issues](https://github.com/chazmcgarvey/git-codeowners/issues)
177 When submitting a bug or request, please include a test-file or a
178 patch to an existing test-file that illustrates the bug or desired
183 Charles McGarvey <chazmcgarvey@brokenzipper.com>
185 # COPYRIGHT AND LICENSE
187 This software is copyright (c) 2019 by Charles McGarvey.
189 This is free software; you can redistribute it and/or modify it under
190 the same terms as the Perl 5 programming language system itself.