jj-file-track(1)

πŸ’– jj-file-track β€” the manual, but make it make sense πŸ’–

okay bestie, welcome to jj-file-track(1) from the General Commands Manual ✨ this is your girl's guide to telling jj "hey, actually track this file bestie" β€” let's get into it πŸ’…


✨ NAME ✨

jj-file-track β€” start tracking specified paths in the working copy πŸŽ€


🌸 SYNOPSIS 🌸

jj file track [--include-ignored] [-R|--repository]
[--ignore-working-copy] [--no-integrate-operation] [--ignore-immutable]
[--at-operation] [--debug] [--color] [--quiet] [--no-pager] [--config]
[--config-file] [-h|--help] <FILESETS>

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole point: you start tracking specified paths in the working copy. Periodt. πŸ’–

If you pass no arguments, literally every path that is not ignored gets tracked. all of them. the whole vibe. ✨

Now here's the plot twist 🫢 by default, new files in the working copy are automatically tracked anyway, so this command has no effect β€” it's giving "you had one job and the job was already done." 😭

You can configure which paths get auto-tracked by setting snapshot.auto-track (like, say, to "none()" or "glob:**/*.rs"). And files that DON'T match that pattern? Those you can manually track with this very command, iykyk. The default pattern is all(). πŸ‘‘


πŸ’… OPTIONS πŸ’…

  • --include-ignored β€” track paths even if they're ignored or too large. like, by default jj file track will NOT track files that are ignored by .gitignore or that exceed the maximum file size. This flag overrides those restrictions and explicitly tracks the paths you named. she said "rules are a suggestion" πŸ’€βœ¨
  • -h, --help β€” print help (see a summary with -h) πŸŽ€
  • <FILESETS> β€” the paths to track 🫢

πŸ‘‘ GLOBAL OPTIONS πŸ‘‘

these ones work across the board, bestie β€” they're the main character energy of jj πŸ”₯

  • -R, --repository <REPOSITORY> β€” path to the 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, don't worry" πŸ’œ
  • --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, and the working copy is also updated at the end of the command if the command modified the working-copy commit (@). So if you want to avoid snapshotting and instead see a possibly stale working-copy commit, use --ignore-working-copy. This is lowkey useful in, like, a command prompt β€” especially if you've got another process committing the working copy. πŸ™ˆ
Also, loading the repository at a specific operation with --at-operation implies --ignore-working-copy. no cap. ✨
  • --no-integrate-operation β€” run the command as usual but don't integrate any operations. So the operations still get created like normal, but they do NOT get integrated into the operation log. The working copy also doesn't get updated. 🫢

The command will print the resulting operation ID. You can pass that to, like, 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. πŸ’…

⚠️ 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 still pushing. πŸ’€
  • --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. πŸ”₯

This option only affects the check. It does not affect the immutable_heads() revset or the immutable template keyword. just the check. that's it. that's the tweet. πŸ’œ

  • --at-operation <AT_OPERATION> β€” the 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 there are 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. And --at-op=@ is pretty much the same as the default, except that divergent operations will never be merged. ✨

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 while 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. she said "you can, not that you should" πŸ’€

  • --debug β€” enable debug logging πŸ›
  • --color <WHEN> β€” when to colorize output. possible values:
    • always
    • never
    • debug
    • auto
  • --quiet β€” silence non-primary command output. Like, jj file list will still list files, but it won't tell you if the working copy was snapshotted or if descendants were rebased. Warnings and errors will still be printed tho. πŸŽ€
  • --no-pager β€” disable the pager 🚫
  • --config <NAME=VALUE> β€” additional configuration options (and yeah, it can be repeated πŸ’…). The name should be specified as TOML dotted keys. The value should be specified as a TOML expression. If a string value isn't enclosed by any TOML constructs (like array notation), the quotes can be omitted. 🫢
  • --config-file <PATH> β€” additional configuration files (also repeatable, slay ✨)

🧚 quick vibe check recap 🌸

  • no args = track everything not ignored
  • new files are auto-tracked by default so this command is usually doing nothing
  • snapshot.auto-track controls the auto-tracking pattern, default all()
  • --include-ignored = overrides the ignore and file-size restrictions

and that's the whole page bestie, you ate it, no crumbs left πŸ“ stay iconic, stay tracked πŸ’–

this was jj-file-track from the General Commands Manual β€” the track manual page <rainbow>jj-file-track(1)</rainbow> 🫢✨ periodt. πŸ’…

πŸ“¦ where this page comes from