This new alias setup provides four quick traversal options: Moving ahead one commit (`jen` for edit next), backwards (`jep` for edit previous), as well as doing the same but creating new 'working copies' instead of going directly to a commit (`jenn` and `jepp`).
73 lines
1.5 KiB
Bash
73 lines
1.5 KiB
Bash
#!/usr/bin/env sh
|
|
|
|
if ! exist jj; then
|
|
return 1
|
|
fi
|
|
|
|
alias j="jj"
|
|
if exist lazyjj; then
|
|
alias lj="lazyjj"
|
|
fi
|
|
|
|
alias jn="jj new"
|
|
alias jds="jj describe"
|
|
alias jc="jj commit"
|
|
|
|
# finding out the current snapshot
|
|
js() {
|
|
if [ "$#" -eq 0 ]; then
|
|
jj status
|
|
else
|
|
jj show "$*"
|
|
fi
|
|
}
|
|
alias jw="jj show"
|
|
alias jd="jj diff"
|
|
|
|
# for describe-and-edit workflows
|
|
# https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-edit-workflow.html
|
|
alias je="jj edit"
|
|
alias jen="jj next --edit"
|
|
alias jep="jj prev --edit"
|
|
alias jenn="jj next"
|
|
alias jepp="jj prev"
|
|
|
|
# for squash-and-go workflows
|
|
# https://steveklabnik.github.io/jujutsu-tutorial/real-world-workflows/the-squash-workflow.html
|
|
alias jss="jj squash"
|
|
alias jsi="jj squash --interactive"
|
|
|
|
# oops buttons
|
|
alias ju="jj undo"
|
|
# allows you to split the current change into multiple
|
|
alias ji="jj split"
|
|
|
|
# revset info
|
|
alias jl="jj log -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($*)"
|
|
}
|
|
|
|
# show branches (i.e. head commits) w a couple previous commits
|
|
alias jh="jj log -r 'ancestors(heads(all()), 3)'"
|
|
|
|
alias jrb="jj rebase"
|
|
|
|
# 'branching' bookmark work
|
|
alias jb="jj bookmark"
|
|
alias jbm="jj bookmark set main"
|
|
|
|
# remote work
|
|
alias jrv="jj git remote list"
|
|
alias jp="jj git push"
|