From 98dca7ec04f5799c4619231b2c65bb0ddfaee2e2 Mon Sep 17 00:00:00 2001
From: Marty Oehme <marty.oehme@gmail.com>
Date: Sat, 22 Feb 2025 11:00:12 +0100
Subject: [PATCH] jj: Extend log aliases

The new log aliases follow one logic: small letters are default and
capital letters show 'all' changes. Thus, `j` defaults to showing the
simple log and `J` the same log but for all changes.
`jl` shows oneline logs, `JL` oneline logs for all changes.
`jlo` shows log summaries, `JLO` for all changes.
And finally `jloo` and `JLOO` show the details patches for each change.
---
 vcs/jj/config/jj/config.toml   | 1 +
 vcs/jj/config/sh/alias.d/jj.sh | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml
index db6f968..fefbb76 100644
--- a/vcs/jj/config/jj/config.toml
+++ b/vcs/jj/config/jj/config.toml
@@ -12,6 +12,7 @@ subprocess = true
 private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')" # refuse to push WIP commits
 
 [ui]
+default-command = "log"
 diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
 pager = "delta"
 
diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh
index ad55ec0..22a6dd5 100644
--- a/vcs/jj/config/sh/alias.d/jj.sh
+++ b/vcs/jj/config/sh/alias.d/jj.sh
@@ -43,11 +43,13 @@ alias ju="jj undo"
 alias ji="jj split"
 
 # revset info
+alias J="jj log -r 'all()'" # mirror default command being log
 alias jl="jj log -T builtin_log_oneline"
-alias jL="jj log -r 'all()'"
+alias JL="jj log -T builtin_log_oneline -r 'all()'"
 alias jlo="jj log --summary"
-alias jLO="jj log --summary -r 'all()'"
+alias JLO="jj log --summary -r 'all()'"
 alias jloo="jj log --patch"
+alias JLOO="jj log --patch -r 'all()'"
 alias jol="jj op log"
 jlf() {
     jj log -r "description($*)"