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
27 git repos. In particular, it can be used to quickly find out who owns a
28 particular file in a monorepo (or monolith).
30 THIS IS EXPERIMENTAL! The interface of this tool and its modules will
31 probably change as I field 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:
45 You can also choose to download git-codeowners as a self-contained
48 curl -OL https://raw.githubusercontent.com/chazmcgarvey/git-codeowners/solo/git-codeowners
49 chmod +x git-codeowners
51 To hack on the code, clone the repo instead:
53 git clone https://github.com/chazmcgarvey/git-codeowners.git
55 make bootstrap # installs dependencies; requires cpanm
61 Print the program name and version to STDOUT, and exit.
67 Print the synopsis to STDOUT, and exit.
71 You can also use --manual to print the full documentation.
75 Enable colorized output.
77 Color is ON by default on terminals; use --no-color to disable. Some
78 environment variables may also alter the behavior of colorizing output:
80 * NO_COLOR - Set to disable color (same as --no-color).
82 * COLOR_DEPTH - Set the number of supportable colors (e.g. 0, 16,
87 Specify the output format to use. See "FORMAT".
93 eval "$(lintany --shell-completion)"
95 Print shell code to enable completion to STDOUT, and exit.
97 Does not yet support Zsh...
103 git-codeowners [show] [--format FORMAT] [--[no-]project] [PATH...]
105 Show owners of one or more files in a repo.
109 git-codeowners owners [--format FORMAT] [--pattern PATTERN]
113 git-codeowners patterns [--format FORMAT] [--owner OWNER]
117 git-codeowners create [REPO_DIRPATH|CODEOWNERS_FILEPATH]
119 Create a new CODEOWNERS file for a specified repo (or current
124 git-codeowners update [REPO_DIRPATH|CODEOWNERS_FILEPATH]
126 Update the "unowned" list of an existing CODEOWNERS file for a
127 specified repo (or current directory).
131 The --format argument can be one of:
133 * csv - Comma-separated values (requires Text::CSV)
135 * json:pretty - Pretty JSON (requires JSON::MaybeXS)
137 * json - JSON (requires JSON::MaybeXS)
139 * table - Table (requires Text::Table::Any)
141 * tsv - Tab-separated values (requires Text::CSV)
143 * yaml - YAML (requires YAML)
145 * FORMAT - Custom format (see below)
149 You can specify a custom format using printf-like format sequences.
150 These are the items that can be substituted:
154 * %O - Owner or owners
166 The syntax also allows padding and some filters. Examples:
168 git-codeowners show -f ' * %-50F %O' # default for "show"
169 git-codeowners show -f '%{quote}F,%{quote}O' # ad hoc CSV
170 git-codeowners patterns -f '--> %{color:0c0}T' # whatever...
174 * quote - Quote the replacement string.
176 * color:FFFFFF - Colorize the replacement string (if color is ON).
178 * nocolor - Do not colorize replacement string.
182 Table formatting can be done by one of several different modules, each
183 with its own features and bugs. The default module is
184 Text::Table::Tiny, but this can be overridden using the PERL_TEXT_TABLE
185 environment variable if desired, like this:
187 PERL_TEXT_TABLE=Text::Table::HTML git-codeowners -f table
189 The list of available modules is at "@BACKENDS" in Text::Table::Any.
193 Please report any bugs or feature requests on the bugtracker website
194 https://github.com/chazmcgarvey/git-codeowners/issues
196 When submitting a bug or request, please include a test-file or a patch
197 to an existing test-file that illustrates the bug or desired feature.
201 Charles McGarvey <chazmcgarvey@brokenzipper.com>
203 COPYRIGHT AND LICENSE
205 This software is copyright (c) 2019 by Charles McGarvey.
207 This is free software; you can redistribute it and/or modify it under
208 the same terms as the Perl 5 programming language system itself.