-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds a new command to run a `test: closure` against a repo to bisect a new bug. as can be seen in the [documentation](https://github.com/amtoine/nu-git-manager/blob/gm-repo-bisect/docs/nu-git-manager-sugar/git/gm-repo-bisect.md) - the `test: closure` should return non-zero exit codes for _bad_ revisions - the `--good` and `--bad` options should point to the first valid known _good_ and _bad_ revisions - when the `test: closure` is expensive to run and `--good` and `--bad` are assument to be valid, their checks can be skipped with `--no-check`
- Loading branch information
Showing
5 changed files
with
170 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# `gm repo bisect` (`nu-git-manager-sugar git`) | ||
bisect a worktree by running a piece of code repeatedly | ||
|
||
# Examples | ||
```nushell | ||
# find a bug that was introduced in Nushell in `nushell/nushell | ||
gm repo bisect --good 0.89.0 --bad 4458aae { | ||
cargo run -- -n -c "def foo [x: list<string>] { $x }; foo []" | ||
} | ||
``` | ||
``` | ||
724818030dd1de392c54788eab5030074d694ecd | ||
``` | ||
--- | ||
```nushell | ||
# avoid running the test twice more if it is expensive and you're sure | ||
# `--good` and `--bad` are indeed "good" and "bad" | ||
gm repo bisect --good $good --bad $bad --no-check $test | ||
``` | ||
|
||
## Parameters | ||
- parameter_name: test | ||
- parameter_type: positional | ||
- syntax_shape: closure() | ||
- is_optional: false | ||
- description: the code to run to check a given revision, should return a non-zero exit code for bad revisions | ||
--- | ||
- parameter_name: good | ||
- parameter_type: named | ||
- syntax_shape: string | ||
- is_optional: true | ||
- description: the initial known "good" revision | ||
--- | ||
- parameter_name: bad | ||
- parameter_type: named | ||
- syntax_shape: string | ||
- is_optional: true | ||
- description: the initial known "bad" revision | ||
--- | ||
- parameter_name: no-check | ||
- parameter_type: switch | ||
- is_optional: true | ||
- description: don't check if `--good` and `--bad` are indeed "good" and "bad" | ||
|
||
## Signatures | ||
| input | output | | ||
| --------- | -------- | | ||
| `nothing` | `string` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters