From 0bd604298f574f9d3a9b2d36e3f6b87345975502 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Fri, 7 Feb 2025 23:15:09 +0100 Subject: [PATCH] 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. --- vcs/jj/config/jj/config.toml | 6 +++++- vcs/jj/config/sh/alias.d/jj.sh | 20 +++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index 84b0f0f..1636b18 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -3,10 +3,14 @@ email = "marty.oehme@gmail.com" name = "Marty Oehme" [signing] -sign-all = false backend = "gpg" key = "73BA40D5AFAF49C9" +[git] +sign-on-push = true +subprocess = true +private-commits = "description(glob:'wip:*')" # refuse to push WIP commits + [ui] default-command = "log" diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 7734a27..4a59f92 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -23,6 +23,18 @@ js() { } 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 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 jl="jj log -r '@ | ancestors(trunk()..(visible_heads() & mine()), 3) | trunk()' -T builtin_log_oneline" alias jL="jj log -r 'all()'" @@ -40,13 +52,7 @@ 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 +# show branches (i.e. head commits) w a couple previous commits alias jb="jj log -r 'ancestors(heads(all()), 3)'" alias jrb="jj rebase"