diff --git a/vcs/jj/config/nushell/autoload/jj.nu b/vcs/jj/config/nushell/autoload/jj.nu new file mode 100644 index 0000000..43184cc --- /dev/null +++ b/vcs/jj/config/nushell/autoload/jj.nu @@ -0,0 +1,73 @@ +# exactly mirror the aliases in sh/ + +alias j = jj +alias lj = lazyjj + +alias jn = jj new +alias jna = jj new -A@ +alias jnb = jj new -B@ +alias jds = jj describe +alias jc = jj commit + +alias js = jj status +alias jw = jj show +alias jd = jj diff + +alias je = jj edit +alias jen = jj next --edit +alias jep = jj prev --edit +alias jenn = jj next +alias jepp = jj prev + +alias jed = jj edit -r 'latest(heads(descendants(@)))' # edit furthest descendant +alias jet = jj edit -r 'latest(heads(descendants(trunk())))' # edit trunk descendant +alias jel = jj edit -r 'latest(all())' # edit newest change + +alias jss = jj squash +alias jsi = jj squash --interactive + +alias ju = jj undo +# allows you to split the current change into multiple +alias ji = jj split +# quickly get rid of a change +alias jab = jj abandon + +# revset info +alias J = jj log -r 'all()' # mirror default command being log +alias jl = jj log -T builtin_log_oneline -r 'recent()' +alias JL = jj log -T builtin_log_oneline -r 'all()' +alias jlo = jj log --summary -T builtin_log_compact_full_description -r 'recent()' +alias JLO = jj log --summary -T builtin_log_compact_full_description -r 'all()' +alias jloo = jj log --patch -r 'recent()' +alias JLOO = jj log --patch -r 'all()' +alias jlr = jj log # 'raw' log mode for custom opts +alias jol = jj op log + +# Find given term in change descriptions +def --wrapped jlf [search: string, ...flags] { + ^jj log -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +# Find given term in change descriptions and display summary +def --wrapped jlof [search: string, ...flags] { + ^jj log --summary -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +# Find given term in change descriptions and display patches +def --wrapped jloof [search: string, ...flags] { + ^jj log --patch -r $"description\(substring-i:\"($search)\"\)" ...$flags +} +alias jlfw = jj log -r "wip()" # Find 'WIP:'-prefixed changes +alias jlfp = jj log -r "private()" # Find 'PRIVATE:'-prefixed changes + +alias jh = jj log -r 'ancestors(heads(all()), 3)' + +alias jrb = jj rebase + +alias jb = jj bookmark +alias jbl = jj bookmark list +# Set 'main' bookmark to given revision, or to current ('@') +def --wrapped jbm [rev: string = "@", ...flags] { + ^jj bookmark set -r $rev main +} + +alias jrv = jj git remote list +alias jp = jj git push