jj-operation-diff(1)

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

πŸ’… jj-operation-diff(1) ✨

okay so bestie, welcome to jj-operation-diff(1) β€” that's the manual page name, we're folding it in right here at the top like a little name tag at a party πŸŽ€. This is one of the General Commands Manual pages for Jujutsu (jj), and it's literally all about comparing what happened to your repo between two operations. iykyk.


🌸 NAME 🌸

jj-operation-diff β€” compare changes to the repository between two operations. that's it, that's the vibe check πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

jj operation diff [--operation] [-R|--repository] [-f|--from]
[--ignore-working-copy] [--no-integrate-operation] [-t|--to]
[-G|--no-graph] [--ignore-immutable] [--at-operation] [-p|--patch]
[--debug] [-s|--summary] [--color] [--stat] [--quiet] [--types]
[--name-only] [--no-pager] [--config] [--git] [--color-words]
[--config-file] [--tool] [--context] [--ignore-all-space]
[--ignore-space-change] [--show-changes-in] [-h|--help]

🌈 DESCRIPTION 🌈

Compare changes to the repository between two operations. yes. that's the whole thing. it's giving "diff, but for the operation log" and honestly? iconic πŸ’…


✨ OPTIONS ✨

  • --operation <OPERATION> β€” show the repository changes in this operation, compared to its parent πŸ‘‘
  • -f, --from <FROM> β€” show repository changes from this operation 🫢
  • -t, --to <TO> β€” show repository changes to this operation 🫢
  • -G, --no-graph β€” show a flat list of modified changes instead of a graph. flat list era, no tree, no drama 🌸
  • -p, --patch β€” show a patch of the modifications to changes 🩹
    • ok so important detail: if the previous version has different parents, it will be temporarily rebased to the parents of the new version, so the diff is not contaminated by unrelated changes. the way it does that just so your diff stays clean πŸ˜­πŸ’–
  • -h, --help β€” print help (see a summary with -h) πŸ™ˆ

πŸŽ€ DIFF FORMATTING OPTIONS πŸŽ€

  • -s, --summary β€” for each path, show only whether it was modified, added, or deleted. short and sweet, like a text back πŸ’¬
  • --stat β€” show a histogram of the changes πŸ“Š
  • --types β€” for each path, show only its type before and after πŸ”€
    • The diff is shown as two letters. The first letter indicates the type before and the second letter indicates the type after. - indicates that the path was not present, F represents a regular file, L represents a symlink, C represents a conflict, and G represents a Git submodule. two little letters carrying so much info fr fr πŸ’€
  • --name-only β€” for each path, show only its path 🏷️
    • Typically useful for shell commands like:
jj diff -r @- --name-only | xargs perl -pi -e's/OLD/NEW/g'
  • --git β€” show a Git-format diff. classic, familiar, lowkey comforting 🧚
  • --color-words β€” show a word-level diff with changes indicated only by color 🌈
  • --tool <TOOL> β€” generate diff by external command πŸ”§
    • A builtin format can also be specified as :<name>. For example, --tool=:git is equivalent to --git. yup, shortcut queen πŸ‘‘
  • --context <CONTEXT> β€” number of lines of context to show πŸͺŸ
  • --ignore-all-space β€” ignore whitespace when comparing lines πŸ«₯
  • --ignore-space-change β€” ignore changes in amount of whitespace when comparing lines πŸ«₯
  • --show-changes-in <REVSETS> β€” show only changed revisions matching the given revset expression 🎯
    • If no revisions are specified, this defaults to the revsets.op-diff-changes-in setting. defaults, gotta love 'em πŸ’œ

πŸ’– 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 goes looking for home πŸ₯Ί
  • --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. so it's automatic, no need to say it twice πŸ’…
  • --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, one ID πŸ”‘
    • Note that this does not prevent side effects outside the repo. For example, jj git push --no-integrate-operation will still perform the push. > ⚠️ bestie READ THIS ONE: the push still happens. the flag is not a "do nothing" button, ok? 😭
  • --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. root commit stays protected, no exceptions πŸ‘‘
    • This option only affects the check. It does not affect the immutable_heads() revset or the immutable template keyword.
  • --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.
    • 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. rare but possible, the chaotic option πŸŒ€
  • --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. the main character output stays, the side commentary dips ✌️
    • Warnings and errors will still be printed. don't worry, you'll still hear about the bad stuff 🚨
  • --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) πŸ“š

and that's the whole page bestie!! every option, every default, every warning β€” all present and accounted for 🫢✨

ok so about the little sign-off at the bottom of the original page πŸ₯Ί β€” the footer there just reads diff on the left and jj-operation-diff(1) on the right, no version string and no date anywhere in sight. so consider this the cute version of that: page name jj-operation-diff(1), footer word diff, and no date/version to report β€” we keep it 100% honest around here πŸ’―πŸ’– mwah, go diff some operations, you got this πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from