Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Sep 19, 2024
1 parent cff02fc commit 101995a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ This will show you which flags can safely enabled, and which flags require a mig
### --bisect

`--bisect` flag allows you to bisect Bazel versions to find which version introduced a build failure. You can specify the range of versions to bisect with `--bisect=<GOOD>..<BAD>`, where GOOD is the last known working Bazel version and BAD is the first known non-working Bazel version. Bazelisk uses [GitHub's compare API](https://docs.github.com/en/rest/commits/commits#compare-two-commits) to get the list of commits to bisect. When GOOD is not an ancestor of BAD, GOOD is reset to their merge base commit.
The meaning of GOOD and BAD can be reversed by prefixing the range with `~`, e.g. `--bisect=!6.0.0..HEAD` will find the first version 6.0.0 and HEAD that *fixes* the build.
The meaning of GOOD and BAD can be reversed by prefixing the range with `~`, e.g. `--bisect=~6.0.0..HEAD` will find the first version 6.0.0 and HEAD that *fixes* the build.

Examples:
```shell
Expand Down
6 changes: 3 additions & 3 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,14 @@ func RunBazeliskWithArgsFuncAndConfigAndOut(argsFunc ArgsFunc, repos *Repositori
} else if len(args) > 0 && strings.HasPrefix(args[0], "--bisect") {
// When --bisect is present, we run the bisect logic.
if !strings.HasPrefix(args[0], "--bisect=") {
return -1, fmt.Errorf("Error: --bisect must have a value. Expected format: '--bisect=[!]<good bazel commit>..<bad bazel commit>'")
return -1, fmt.Errorf("Error: --bisect must have a value. Expected format: '--bisect=[~]<good bazel commit>..<bad bazel commit>'")
}
value := args[0][len("--bisect="):]
commits := strings.Split(value, "..")
if len(commits) == 2 {
bisect(commits[0], commits[1], args[1:], bazeliskHome, repos, config)
} else {
return -1, fmt.Errorf("Error: Invalid format for --bisect. Expected format: '--bisect=[!]<good bazel commit>..<bad bazel commit>'")
return -1, fmt.Errorf("Error: Invalid format for --bisect. Expected format: '--bisect=[~]<good bazel commit>..<bad bazel commit>'")
}
}

Expand Down Expand Up @@ -805,7 +805,7 @@ func getBazelCommitsBetween(oldCommit string, newCommit string, config config.Co

mergeBaseCommit := compResp.MergeBaseCommit.SHA
if mergeBaseCommit != compResp.BaseCommit.SHA {
fmt.Printf("The old Bazel commit is not an ancestor of the good Bazel commit, overriding the old Bazel commit to the merge base commit %s\n", mergeBaseCommit)
fmt.Printf("The old Bazel commit is not an ancestor of the new Bazel commit, overriding the old Bazel commit to the merge base commit %s\n", mergeBaseCommit)
oldCommit = mergeBaseCommit
}

Expand Down

0 comments on commit 101995a

Please sign in to comment.