jj-bisect-run(1)

πŸ“¦
version 0.46.0 Β· 3 versions
, in arch rolling, nixpkgs unstable

πŸ’… 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 0 means "good" βœ…
  • 125 means 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:

  • always
  • never
  • debug
  • auto
  • --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