From 98dad64976ad0512d424059ea206e17734aa8541 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 12 Feb 2025 18:29:16 +0100 Subject: [PATCH] jj: Add jj insert alias for forgotten commits Allows the user to just use the `ji` alias to quickly create a (previous) change, commit whatever they forgot and move back to the current commit. --- vcs/jj/config/sh/alias.d/jj.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 92f3092..2e51bfa 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -34,6 +34,12 @@ alias jee="jj next --edit" alias jss="jj squash" alias jsi="jj squash --interactive" +# oops buttons +alias ju="jj undo" +# for damn,-forgot-to-split-this-commit workflow +# Creates a new commit before with your selected changes, lets you describe it and carry on +alias ji="jj new -B@ --no-edit && jj squash --interactive && jj edit '@-' && jj describe && jj edit '@+'" + # revset info alias jl="jj log -T builtin_log_oneline" alias jL="jj log -r 'all()'" @@ -56,6 +62,5 @@ alias jb="jj log -r 'ancestors(heads(all()), 3)'" alias jrb="jj rebase" -alias ju="jj undo" alias jp="jj git push"