jj: Add git commit signing and private commits

Git commits, on push, will be signed by default (just like my git
configuration itself) but *not* every change is signed since that is a
hassle with the working copy technically also being an ever changing
git commit.

Additionally, added a private-commit option which will refuse to push
commits beginning with 'wip: ' to any remote, which is not super useful
for my current use cases but also a nice feature and fun to experiment
with for the future.
This commit is contained in:
Marty Oehme 2025-02-07 23:15:09 +01:00
parent 7922e5285f
commit 0bd604298f
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 18 additions and 8 deletions

View file

@ -3,10 +3,14 @@ email = "marty.oehme@gmail.com"
name = "Marty Oehme" name = "Marty Oehme"
[signing] [signing]
sign-all = false
backend = "gpg" backend = "gpg"
key = "73BA40D5AFAF49C9" key = "73BA40D5AFAF49C9"
[git]
sign-on-push = true
subprocess = true
private-commits = "description(glob:'wip:*')" # refuse to push WIP commits
[ui] [ui]
default-command = "log" default-command = "log"
diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]

View file

@ -23,6 +23,18 @@ js() {
} }
alias jw="jj show" alias jw="jj show"
alias jd="jj diff" 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 jee="jj next --edit"
# 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"
# revset info
alias jln="jj log -T builtin_log_oneline" 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 '@ | ancestors(trunk()..(visible_heads() & mine()), 3) | trunk()' -T builtin_log_oneline"
alias jL="jj log -r 'all()'" alias jL="jj log -r 'all()'"
@ -40,13 +52,7 @@ jloof() {
jj log --patch -r "description($*)" jj log --patch -r "description($*)"
} }
alias jss="jj squash" # show branches (i.e. head commits) w a couple previous commits
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 jb="jj log -r 'ancestors(heads(all()), 3)'"
alias jrb="jj rebase" alias jrb="jj rebase"