Skip to content

Commit 0303990

Browse files
committed
Add instructions to the README
1 parent 8815d75 commit 0303990

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,33 @@
33
Parses GitHub CODEOWNERS[^1] files.
44

55
[^1]: See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
6+
7+
## Installation
8+
```sh
9+
cargo install --git https://github/triarius/git-codeowners.git
10+
```
11+
12+
To invoke this as `git codeowners` instead of `/path/to/git-codeowners`, ensure that
13+
1. `git` is installed and in your `PATH`
14+
2. The location `cargo` installs executables to is in your `PATH`. This is typically `~/.local/share/cargo/bin`.
15+
16+
## Usage
17+
Change directory to a git repo with a CODEOWNERS file.
18+
19+
```
20+
Usage: git-codeowners [OPTIONS] <COMMAND>
21+
22+
Commands:
23+
find Find owners for the specified paths. Reads paths from STDIN if not provided as positional arguments
24+
help Print this message or the help of the given subcommand(s)
25+
26+
Options:
27+
-p, --path <PATH> Path to the CODEOWNERS file [default: .github/CODEOWNERS]
28+
-h, --help Print help
29+
-V, --version Print version
30+
```
31+
32+
### Detecting CODEOWNERS of all files changed in a branch
33+
```sh
34+
git diff (git merge-base origin/main HEAD) --name-only | git codeowners find
35+
```

0 commit comments

Comments
 (0)