jj-bisect-run(1)
π
jj-bisect-run β the jj bisect run glow-up guide π
okay so this is the manual page for jj-bisect-run from the General Commands Manual, and bestie, it's literally the tool that runs your command over and over to hunt down the first bad revision. no cap. let's get into it β¨
πΈ NAME πΈ
jj-bisect-run β run a given command to find the first bad revision π΅οΈββοΈ
π¦ SYNOPSIS π¦
jj bisect run [-R|--repository] [--ignore-working-copy] [--find-good]
[--no-integrate-operation] [--ignore-immutable] [--trust-endpoints]
[--at-operation] [--debug] [--color] [--quiet] [--no-pager] [--config]
[--config-file] [-h|--help] <-r|--range> [COMMAND] [ARGS]
π DESCRIPTION π
Run a given command to find the first bad revision. that's the whole vibe fr fr.
It uses binary search to find the first "bad" revision. Every revision gets evaluated by running the given command (the deets live in the documentation for <COMMAND>, so peek down there π).
So here's the assumption it's working off of: if a given revision is "bad", then all its descendants in the input range are also "bad". Slay, consistent. But if you pass --find-good, it flips that assumption all the way around: if a given revision is "good", all of its descendants are assumed to be "good". Then jj bisect run goes looking for the first "good" revision instead. iconic behavior tbh.
π‘ Hint: you can pass your shell as the command, then run manual tests inside a script. when you're done, make sure to exit the shell with an appropriate error code depending on the desired outcome (e.g., exit 0 to mark the revision as "good"). yes queen, control the exit code π«Ά
Example: to run cargo test with the changes from revision xyz applied:
jj bisect run --range v1.0..main -- bash -c "jj duplicate xyz -B @ && cargo test"
β¨ OPTIONS β¨
-r,--range<REVSETS> β range of revisions to bisect (can be repeated)
this is typically a range like v1.0..main. the heads of the range are assumed to be bad, and ancestors of the range that are not also in the range are assumed to be good. the union of all given ranges is used as the input for the bisection. yes, union β you can stack them π
--find-goodβ find the first good revision instead
normally, jj bisect run looks for a revision in the provided REVSETS that's bad and whose parents are good. with --find-good, jj bisect run instead finds a commit that's good and whose parents are bad. plot twist π
COMMAND is still expected to exit with code 0 if and only if the revision is good. no switching that up, sorry bestie.
--trust-endpointsβ skip the pre-bisection checks
by default, COMMAND will be run on every revision jj bisect run assumes to be good or bad before bisection actually begins, as detailed under the documentation for COMMAND. this flag disables those checks. highkey trust issues but okay π«‘
-h,--helpβ print help (see a summary with-h)[COMMAND]β command to run to determine the status of a revision
each revision being checked will be directly edited (it will become the current working copy) before running this command. the exit status of the command is what marks revisions as "good" or "bad", and here's the exact breakdown, memorize it:
- status
0means "good" β 125means to skip the revision βοΈ127(command not found) will abort the bisection π- any other non-zero exit status means the revision is "bad" β
in order for bisection to be meaningful, COMMAND must succeed for every revision in heads(REVSETS), and it must fail for every revision in parents(connected(REVSETS)) ~ connected(REVSETS); if you're using --find-good, these checks are reversed. (visit https://docs.jj-vcs.dev/latest/revsets/ for more info about the jj revset language π§)
the target's commit ID is available to the command in the $JJ_BISECT_TARGET environment variable. go grab it π
[ARGS]β arguments to pass to the command
π‘ Hint: use a--separator to allow passing arguments starting with-. for example:jj bisect run --range=... -- test -f some-file. the--is doing so much heavy lifting here, respect it π«Ά
π GLOBAL OPTIONS π
-R,--repository<REPOSITORY> β path to repository to operate on
by default, Jujutsu searches for the closest .jj/ directory in an ancestor of the current working directory. it's giving "i'll find my people wherever they are" π
--ignore-working-copyβ don't snapshot the working copy, and don't update it
by default, Jujutsu snapshots the working copy at the beginning of every command. the working copy is also updated at the end of the command, if the command modified the working-copy commit (@). if you want to avoid snapshotting the working copy and instead see a possibly stale working-copy commit, you can use --ignore-working-copy. this may be useful e.g. in a command prompt, especially if you have another process that commits the working copy.
loading the repository at a specific operation with --at-operation implies --ignore-working-copy. they come as a set, iykyk π
--no-integrate-operationβ run the command as usual but don't integrate any operations
when this option is given, the operations will still be created as usual but they will not be integrated to the operation log. the working copy will also not be updated.
the command will print the resulting operation ID. you can pass that to e.g. jj --at-op to inspect the resulting repo state, or you can pass it to jj op restore to restore the repo to that state. you can also pass the ID to jj op integrate to integrate the operation. so many doors open πͺβ¨
β οΈ note that this does not prevent side effects outside the repo. for example, jj git push --no-integrate-operation will still perform the push. the push is happening, bestie. it's real. π
--ignore-immutableβ allow rewriting immutable commits
by default, Jujutsu prevents rewriting commits in the configured set of immutable commits. this option disables that check and lets you rewrite any commit but the root commit. rebel era π€
this option only affects the check. it does not affect the immutable_heads() revset or the immutable template keyword. important distinction, don't get it twisted.
--at-operation<AT_OPERATION> β operation to load the repo at
operation to load the repo at. by default, Jujutsu loads the repo at the most recent operation, or at the merge of the divergent operations if any.
you can use --at-op=<operation ID> to see what the repo looked like at an earlier operation. for example jj --at-op=<operation ID> st will show you what jj st would have shown you when the given operation had just finished. --at-op=@ is pretty much the same as the default except that divergent operations will never be merged. time travel but make it version control β³
use jj op log to find the operation ID you want. any unambiguous prefix of the operation ID is enough. no need to type the whole thing, we're not about that life.
when loading the repo at an earlier operation, the working copy will be ignored, as if --ignore-working-copy had been specified.
it is possible to run mutating commands when loading the repo at an earlier operation. doing that is equivalent to having run concurrent commands starting at the earlier operation. there's rarely a reason to do that, but it is possible. chaos is an option bestie π
--debugβ enable debug logging π--color<WHEN> β when to colorize output
possible values:
alwaysneverdebugauto
--quietβ silence non-primary command output
for example, jj file list will still list files, but it won't tell you if the working copy was snapshotted or if descendants were rebased. it's giving minimalism β¨
warnings and errors will still be printed. safety first π«Ά
--no-pagerβ disable the pager--config<NAME=VALUE> β additional configuration options (can be repeated)
the name should be specified as TOML dotted keys. the value should be specified as a TOML expression. if string value isn't enclosed by any TOML constructs (such as array notation), quotes can be omitted.
--config-file<PATH> β additional configuration files (can be repeated)
okay that's the whole page, and yes you ate that π
this was jj-bisect-run(1) from the General Commands Manual β the footer on the og page just says run on the left and jj-bisect-run(1) on the right, no date listed, so that's all the version/source tea we've got. now go bisect something and slay, periodt πππ¦
π¦ where this page comes from
- arch rolling: jujutsu 0.46.0-1 Β· Apache-2.0
- nixpkgs unstable: jujutsu 0.46.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms