|
1 | | -## Your new git-extra command should support |
| 1 | +# Contributing |
2 | 2 |
|
3 | | -* OSX, Linux, BSD (You may need to browse their man page)<sup>*</sup> |
4 | | -* Bash 3.2+ (If you aren't sure, see [the Bash changelog](https://www.tldp.org/LDP/abs/html/bash2.html)) |
5 | | -* Git 2.1+ |
| 3 | +Thanks for contributing! Please read this document before you make a PR. |
6 | 4 |
|
7 | | -<sup>*</sup>If you aren't able to test your new command on a platform, |
8 | | -make that clear in your PR and someone else may be able to test it on their system. |
| 5 | +## Supported Platforms |
9 | 6 |
|
10 | | -## To submit a new command, you should |
| 7 | +Any changes must support the following platforms: |
11 | 8 |
|
12 | | -Let's assume your new command is named `foo`. |
| 9 | +- macOS, Linux, BSDs (You may need to browse their man page) |
| 10 | +- Bash 3.2+ (If you aren't sure, see the [Bash changelog](https://git.savannah.gnu.org/cgit/bash.git/tree/NEWS?h=devel) to see a detailed list of version support for features) |
| 11 | +- Git 2.1+ |
| 12 | + |
| 13 | +If you aren't able to test your new command on a platform, make that clear in your PR; someone else may be able to test it on their system. |
| 14 | + |
| 15 | +## Testing |
| 16 | + |
| 17 | +We now have a testing suite. Run it with `make test`. |
| 18 | + |
| 19 | +It uses the following dependencies (same or later versions): |
| 20 | + |
| 21 | +- `python==3.10` |
| 22 | +- `pytest==7.4.0` |
| 23 | +- `GitPython==3.1.36` |
| 24 | + |
| 25 | +## Adding a New Command |
| 26 | + |
| 27 | +Let's say you wish to add a new command. Assuming your new command is named `foo`: |
13 | 28 |
|
14 | 29 | 1. Write a bash script under `./bin` called `git-foo`. The script should be started with `#!/usr/bin/env bash`. |
15 | 30 | 2. Read `./man/Readme.md` and write documentation for `git-foo`. |
16 | 31 | 3. Don't forget to introduce it in `Commands.md`. |
17 | 32 | 4. Update `./etc/git-extras-completion.zsh`. Just follow existing code. |
18 | 33 | 5. (Optional) Update `./etc/bash_completion.sh`. |
19 | 34 | 6. (Optional) Update `./etc/git-extras.fish`. |
20 | | -7. Run `./check_integrity.sh foo` to check if all done. |
| 35 | +7. (Optional) Add a test under `./tests`. |
| 36 | +8. Run `./check_integrity.sh foo` to check if all done. |
21 | 37 |
|
22 | 38 | You are welcome to open up an issue to discuss new commands or features before opening a pull request. |
0 commit comments