https://github.com/jaedle/test-and-commit-or-revert
test && commit || revert - cli
https://github.com/jaedle/test-and-commit-or-revert
testing testing-tools tests
Last synced: 2 months ago
JSON representation
test && commit || revert - cli
- Host: GitHub
- URL: https://github.com/jaedle/test-and-commit-or-revert
- Owner: jaedle
- License: mit
- Created: 2023-01-28T10:25:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2026-03-30T17:15:56.000Z (3 months ago)
- Last Synced: 2026-03-30T19:16:18.958Z (3 months ago)
- Topics: testing, testing-tools, tests
- Language: Go
- Homepage:
- Size: 8.76 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# test && commit || revert - cli
This is a cli to apply [TCR](https://medium.com/@kentbeck_7670/test-commit-revert-870bbd756864) for your daily work.
## Usage
### Installation through brew
```sh
brew tap jaedle/test-and-commit-or-revert
brew install test-and-commit-or-revert
```
You may use `tcr` afterwards.
### Installation from source
```
task intall
```
This will:
1. Build the binary
2. Copy the build binary into `$HOME/bin`.
Please include `$HOME/bin` into your path configuration.
### Configuration
Create the file `tcr.json` in the git-repository root.
Example:
```json
{
"test": "go test ./..."
}
```
Attributes:
- `test`: test command to run. Whitespaces within arguments (i.e. `task 'argument with space'`) are **not supported**.
### Run tcr
```sh
tcr
```
### Behaviour
| worktree | result of test execution | effect | exit code | test output |
|----------|----------------------------------|--------------------------------------|------------|-------------|
| clean | (will not be executed) | (none) | zero | (none) |
| dirty | tests passed | a new commit is created with changes | zero | swallowed |
| dirty | tests failed | worktree is reset to previous commit | non-zero | shown |
| dirty | test command can not be executed | (none) | non-zero | (none) |