dotfiles/vcs/jj/config/sh/alias.d/jj.sh
Marty Oehme 2eccfe88ec
jj: Improve default log invocation
The default log invoked when hitting `j` is now composed of the working copy history as well as all
ancestors, recent commits to visible heads and the trunk.

`jl` shows the same view, only as oneline commits.
2025-02-14 10:47:50 +01:00

48 lines
1,000 B
Bash

#!/usr/bin/env sh
if ! exist jj; then
return 1
fi
alias j="jj log -r '@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()'"
if exist lazyjj; then
alias lj="lazyjj"
fi
alias js="jj status"
alias jd="jj diff"
alias jn="jj new"
alias jds="jj describe"
alias jc="jj commit"
alias jln="jj log -T builtin_log_oneline"
alias jl="jj log -r '@ | ancestors(trunk()..(visible_heads() & mine()), 3) | trunk()' -T builtin_log_oneline"
alias jL="jj log -r 'all()'"
alias jlo="jj log --summary"
alias jLO="jj log --summary -r 'all()'"
alias jloo="jj log --patch"
alias jol="jj op log"
jlf() {
jj log -r "description($*)"
}
jlof() {
jj log --summary -r "description($*)"
}
jloof() {
jj log --patch -r "description($*)"
}
alias jss="jj squash"
alias jsi="jj squash --interactive"
alias je="jj edit"
alias jee="jj next --edit"
# show branches w a couple commits
alias jb="jj log -r 'ancestors(heads(all()), 3)'"
alias jrb="jj rebase"
alias ju="jj undo"
alias jp="jj git push"