From 5a3117a80a41a1efbe6e4174c61244ef7ae7c16e Mon Sep 17 00:00:00 2001 From: Romain Delamare Date: Sun, 22 Mar 2026 14:51:21 +0100 Subject: [PATCH] Update jj completions for version 0.40.0 --- custom-completions/jj/jj-completions.nu | 211 +++++++++++++++++++++--- 1 file changed, 186 insertions(+), 25 deletions(-) diff --git a/custom-completions/jj/jj-completions.nu b/custom-completions/jj/jj-completions.nu index 488eb8c8..00a52dcb 100644 --- a/custom-completions/jj/jj-completions.nu +++ b/custom-completions/jj/jj-completions.nu @@ -1,37 +1,36 @@ -# Completions based on Jujutsu 0.36.0 +# Completions based on Jujutsu 0.40.0 def operations [] { { options: { sort: false, }, - completions: (^jj op log --ignore-working-copy --no-graph -T 'self.id().short() ++ " " ++ self.description().first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)'), + completions: (^jj op log --ignore-working-copy --color never --no-graph -T 'id.short() ++ " " ++ description.first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)'), } } def revisions [] { - ^jj log --ignore-working-copy --no-graph -r 'all()' -T 'self.change_id().short() ++ " " ++ self.description().first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)' + ^jj log --ignore-working-copy --color never --no-graph -r 'all()' -T 'change_id.short() ++ " " ++ description.first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)' } def all-bookmarks [] { - ^jj bookmark list --ignore-working-copy --all-remotes -T 'if(self.remote() != "git", self.name() ++ if(self.remote(), "@" ++ self.remote()) ++ "\n")' | lines + ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(remote != "git", name ++ if(remote, "@" ++ remote) ++ "\n")' | lines } def local-bookmarks [] { - ^jj bookmark list --ignore-working-copy -T 'if(!self.remote(), self.name() ++ "\n")' | lines + ^jj bookmark list --ignore-working-copy --color never -T 'if(!remote, name ++ "\n")' | lines } def tracked-bookmarks [] { - ^jj bookmark list --ignore-working-copy --all-remotes -T 'if(self.tracked() && self.remote() != "git", self.name() ++ "@" ++ self.remote() ++ "\n")' | lines + ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(tracked && remote != "git", name ++ "\n")' | lines | uniq } def untracked-bookmarks [] { - let remotes = ^jj git remote list --ignore-working-copy | lines | each {|| split row " " | first } - let local = ^jj bookmark list --ignore-working-copy -T 'if(!self.remote(), self.name() ++ "\n")' | lines | each {|b| $remotes | each {|r| $"($b)@($r)" } } | flatten - let tracked = tracked-bookmarks - let local_untracked = $local | where $it not-in $tracked - let remote_untracked = ^jj bookmark list --ignore-working-copy --all-remotes -T 'if(!self.tracked() && self.remote() && self.remote() != "git", self.name() ++ "@" ++ self.remote() ++ "\n")' | lines - $local_untracked ++ $remote_untracked + ^jj bookmark list --ignore-working-copy --color never --all-remotes -T 'if(!tracked && remote != "git", name ++ "\n")' | lines | uniq +} + +def tags [] { + ^jj tag list --ignore-working-copy --color never -T 'if(!remote, name ++ "\n")' | lines } def revsets [] { @@ -39,21 +38,18 @@ def revsets [] { options: { sort: false }, completions: [ ...(all-bookmarks | each {|b| { value: $b, style: purple } }), - ...(^jj log --ignore-working-copy --no-graph -r 'all()' -T 'self.change_id().short() ++ " " ++ self.description().first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)' | each {|o| { ...$o, style: cyan } }), + ...(tags | each {|t| { value: $t, style: default }}), + ...(^jj log --ignore-working-copy --color never --no-graph -r 'all()' -T 'change_id.short() ++ " " ++ description.first_line() ++ "\n"' | parse --regex '(?\w+) (?.*)' | each {|o| { ...$o, style: cyan } }), ] } } def remotes [] { - ^jj git remote list --ignore-working-copy | parse --regex '(?\S+)\s+(?\S+)' + ^jj git remote list --ignore-working-copy --color never | parse --regex '(?\S+)\s+(?\S+)' } def workspaces [] { - ^jj --ignore-working-copy workspace list -T 'self.name() ++ "\n"' | lines -} - -def tags [] { - ^jj --ignore-working-copy tag list -T 'self.name() ++ "\n"' | lines + ^jj --ignore-working-copy --color never workspace list -T 'name ++ "\n"' | lines } def modes [] { @@ -75,9 +71,11 @@ def commands [] { [ 'abandon' 'absorb' + 'arrange' 'bisect' 'bisect run' 'bookmark' + 'bookmark advance' 'bookmark create' 'bookmark delete' 'bookmark forget' @@ -105,6 +103,7 @@ def commands [] { 'file annotate' 'file chmod' 'file list' + 'file search' 'file show' 'file track' 'file untrack' @@ -138,6 +137,7 @@ def commands [] { 'operation' 'operation abandon' 'operation diff' + 'operation integrate' 'operation log' 'operation restore' 'operation revert' @@ -174,6 +174,7 @@ def commands [] { 'util gc' 'util install-man-pages' 'util markdown-help' + 'util snapshot' 'version' 'workspace' 'workspace add' @@ -186,7 +187,15 @@ def commands [] { } def keywords [] { - ['bookmarks', 'config', 'filesets', 'glossary', 'revsets', 'templates', 'tutorial'] + [ + { value: 'bookmarks', description: 'named pointers to revisions' } + { value: 'config', description: 'how and where to set configuration options' } + { value: 'filesets', description: 'a functional language for selecting a set of files' } + { value: 'glossary', description: 'definitions of various terms' } + { value: 'revsets', description: 'a functional language for selecting a set of revision' } + { value: 'templates', description: 'a functional language to customize command output' } + { value: 'tutorial', description: 'show a tutorial to get started with jj' } + ] } def bookmarks-sort [] { @@ -208,6 +217,25 @@ def bookmarks-sort [] { ] } +def tags-sort [] { + [ + 'name' + 'name-' + 'author-name' + 'author-name-' + 'author-email' + 'author-email-' + 'author-date' + 'author-date-' + 'committer-name' + 'committer-name-' + 'committer-email' + 'committer-email-' + 'committer-date' + 'committer-date-' + ] +} + def restore-options [] { [ { value: 'repo', description: 'the jj repo state and local bookmarks' } @@ -231,6 +259,15 @@ def color-when [] { ['always', 'never', 'debug', 'auto'] } +def gerrit-notify [] { + [ + { value: 'none', description: 'no notification' } + { value: 'owner', description: 'notify the change owner' } + { value: 'owner-reviewers', description: 'notify the change owner and reviewers' } + { value: 'all', description: 'notify all relevant users' } + ] +} + # Abandon a revision export extern "jj abandon" [ ...revsets: string@revsets # the revision(s) to abandon (default: @) @@ -269,6 +306,23 @@ export extern "jj absorb" [ --config-file: path # additional configuration file ] +# Interactively arrange the commit graph +export extern "jj arrange" [ + ...revisions: string@revsets # the revisions to edit + --help # print help + -h # print help summary + --repository(-R): path # repository to operate on + --ignore-working-copy # do not snapshot the working copy + --ignore-immutable # allow rewriting immutable commits + --at-operation: string@operations # operation to load the repo at + --debug # enable debug logging + --color: string@color-when # when to colorize output + --quiet # silence non-primary command output + --no-pager # disable the pager + --config: string # additional configuration options + --config-file: path # additional configuration file +] + # Run a given command to find the first bad revision. export extern "jj bisect run" [ command: string # command to run to determine whether the bug is present @@ -289,6 +343,24 @@ export extern "jj bisect run" [ --config-file: path # additional configuration file ] +# Advance the closest bookmarks to a target revision +export extern "jj bookmark advance" [ + ...names: string@local-bookmarks # move bookmarks matching the given name + --to(-t): string@revsets # move bookmarks to this revision + --help # print help + -h # print help summary + --repository(-R): path # repository to operate on + --ignore-working-copy # do not snapshot the working copy + --ignore-immutable # allow rewriting immutable commits + --at-operation: string@operations # operation to load the repo at + --debug # enable debug logging + --color: string@color-when # when to colorize output + --quiet # silence non-primary command output + --no-pager # disable the pager + --config: string # additional configuration options + --config-file: path # additional configuration file +] + # Create a new bookmark export extern "jj bookmark create" [ ...bookmarks: string # the bookmarks to create @@ -308,7 +380,7 @@ export extern "jj bookmark create" [ --config-file: path # additional configuration file ] -# Delete an existing bookmark +# Delete an existing bookmark export extern "jj bookmark delete" [ ...bookmarks: string@local-bookmarks # the bookmarks to delete --help # print help @@ -391,6 +463,7 @@ export extern "jj bookmark move" [ export extern "jj bookmark rename" [ old: string@local-bookmarks # the bookmark to rename new: string # the new name of the bookmark + --overwrite-existing # allow overwriting an existing bookmark --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -428,6 +501,7 @@ export extern "jj bookmark set" [ # Start tracking given remote bookmarks export extern "jj bookmark track" [ ...bookmarks: string@untracked-bookmarks # remote bookmarks to track + --remote: string@remotes # remotes to track bookmark from --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -445,6 +519,7 @@ export extern "jj bookmark track" [ # Start tracking given remote bookmarks export extern "jj bookmark untrack" [ ...bookmarks: string@tracked-bookmarks # remote bookmarks to untrack + --remote: string@remotes # remotes to untrack bookmark from --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -716,7 +791,7 @@ export extern "jj evolog" [ --revisions(-r): string@revsets # follow changes from these revisions --limit(-n): int # limit the number of revisions to show --reversed # show revisions in the opposite order - --no-graph # do not show the graph + --no-graph(-G) # do not show the graph --template(-T): string # render each revision using the given template --patch(-p) # show patch compated to the previous version --summary(-s) # show only whether each path was modified, added, or deleted @@ -800,6 +875,25 @@ export extern "jj file list" [ --config-file: path # additional configuration file ] +# Search for content in files +export extern "jj file search" [ + ...filesets: path # only search files matching these prefixes + --revision(-r): string@revsets # the revision to search files in + --pattern(-p): string # the glob pattern to search for + --help # print help + -h # print help summary + --repository(-R): path # repository to operate on + --ignore-working-copy # do not snapshot the working copy + --ignore-immutable # allow rewriting immutable commits + --at-operation: string@operations # operation to load the repo at + --debug # enable debug logging + --color: string@color-when # when to colorize output + --quiet # silence non-primary command output + --no-pager # disable the pager + --config: string # additional configuration options + --config-file: path # additional configuration file +] + # Print contents of files in a revision export extern "jj file show" [ ...files: path # paths to print @@ -879,6 +973,24 @@ export extern "jj gerrit upload" [ --remote-branch(-b) # the location where your changes are intended to land --remote: string # the gerrit remote to push top --dry-run(-n) # do not actually push the changes to gerrit + --reviewer: string # add these emails as a reviewer + --cc: string # CC these emails on the change + --label(-l): string # add the following labels + --topic: string # applies a topic to the change + --hashtag: string # applies a hashtag to the change + --wip # marks the change as work in progress + --ready # unmarks the change as work in progress + --private # + --remove-private # unmarks the change as private + --publish-comments # publishes any draft comments for the given change + --no-publish-comments # disables publishing of any draft comments + --notify: string@gerrit-notify # who to email notifications to + --submit # directly submit the changes + --skip-validation # skip performing validations + --ignore-attention-set # do not modify the attention set upon uploading + --deadline: string # the deadline after which the push should be aborted + --custom: string # send the following custom keyed values + --trace: string # for debugging Gerrit --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1069,6 +1181,7 @@ export extern "jj git remote add" [ remote: string # the remote name url: string # the remote's URL or path --fetch-tags: string@fetch-tags # configure when to fetch tags + --push-url: string # the URL or path to push to --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1137,7 +1250,9 @@ export extern "jj git remote rename" [ # Set the URL of a Git remote export extern "jj git remote set-url" [ remote: string@remotes # the name of the existing remote - url: string # the new url or path for the remote + url?: string # the new url or path for the remote + --push: string # the URL or path to push to + --fetch: string # the URL or path to fetch from --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1224,6 +1339,7 @@ export extern "jj log" [ --no-graph(-G) # do not show the graph, use a flat list --template(-T): string # use a template to render revisions --patch(-p) # show patch + --count # print the number of commits instead of showing them --summary(-s) # for each path, show only whether it was modified, added, or deleted --stat # show a histogram of the changes --types # for each path, show only its type before and after @@ -1251,6 +1367,7 @@ export extern "jj log" [ # Modify the metadata of a revision without changing its content export extern "jj metaedit" [ ...revsets: string@revsets # the revision(s) to modify + --update-change-id # generate a new change-id --message(-m): string # update the change description --update-author-timestamp # update the author timestamp --update-author # update the author to the configured user @@ -1348,6 +1465,24 @@ export extern "jj operation diff" [ --context: int # 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: string@revsets # only show changes in these revisions + --help # print help + -h # print help summary + --repository(-R): path # repository to operate on + --ignore-working-copy # do not snapshot the working copy + --ignore-immutable # allow rewriting immutable commits + --at-operation: string@operations # operation to load the repo at + --debug # enable debug logging + --color: string@color-when # when to colorize output + --quiet # silence non-primary command output + --no-pager # disable the pager + --config: string # additional configuration options + --config-file: path # additional configuration file +] + +# Make an operation part of the operation log +export extern "jj opreation integrate" [ + opreation: string # the operation to integrate --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1380,6 +1515,7 @@ export extern "jj operation log" [ --context: int # 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: string@revsets # only show operations in these revisions --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1447,6 +1583,7 @@ export extern "jj operation show" [ --context: path # 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: string@revsets # only show changes in these revisions --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1510,6 +1647,7 @@ export extern "jj rebase" [ --before: string@revsets # the revision(s) to insert before --skip-emptied # abandon empty commits --keep-divergent # keep divergent commits + --simplify-parents # simplify parents of rebased commits --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1637,6 +1775,7 @@ export extern "jj show" [ --no-patch # do not show the patch --ignore-all-space(-w) # ignore whitespace when comparing lines --ignore-space-change(-b) # ignore changes in amount of whitespace when comparing lines + --no-patch # do not show the patch --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1851,7 +1990,11 @@ export extern "jj tag delete" [ # List tags export extern "jj tag list" [ ...names: string # show tags whose local name matches + --all-remotes(-a) # show tags from all remotes + --conflicted(-c) # only show conflicted tags + --revision(-r): string@revsets # show tags in these revisions --template(-T): string # render each tag using the given template + --sort: string@tags-sort # sort tags based on the given key --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -1988,7 +2131,23 @@ export extern "jj util gc" [ # Install Jujutsu's manpages to the provided path export extern "jj util install-man-pages" [ - path: path # the path where manpages will installed + path: path # the path where manpages will be installed + --help # print help + -h # print help summary + --repository(-R): path # repository to operate on + --ignore-working-copy # do not snapshot the working copy + --ignore-immutable # allow rewriting immutable commits + --at-operation: string@operations # operation to load the repo at + --debug # enable debug logging + --color: string@color-when # when to colorize output + --quiet # silence non-primary command output + --no-pager # disable the pager + --config: string # additional configuration options + --config-file: path # additional configuration file +] + +# Snapshot the working copy if needed +export extern "jj util snapshot" [ --help # print help -h # print help summary --repository(-R): path # repository to operate on @@ -2040,6 +2199,7 @@ export extern "jj workspace add" [ destination: path # where to create the new workspace --name: string # a name for the workspace --revision(-r): string@revsets # a list of parent revisions for the created workspace + --message(-m): string # the change description to use --sparse-patterns: string@sparse-patterns # how to handle sparse patterns when creating a new workspace --help # print help -h # print help summary @@ -2106,8 +2266,9 @@ export extern "jj workspace rename" [ --config-file: path # additional configuration file ] -# Show the current workspace root directory +# Show the workspace root directory export extern "jj workspace root" [ + --name: string # name of the workspace --help # print help -h # print help summary --repository(-R): path # repository to operate on