From 25c678824737229b1ce562f98ec99d5ccd8d5edd Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 10 Feb 2025 17:29:05 +0100 Subject: [PATCH] jj: Make aliased log revset default in config Instead of aliasing the revset I am always using currently, we simply set it to be the default for any log command. If we want a different revset we can still supply it. Other aliases keep different revsets (e.g. `jL` variants for `all()` revsets). --- vcs/jj/config/jj/config.toml | 4 +++- vcs/jj/config/sh/alias.d/jj.sh | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vcs/jj/config/jj/config.toml b/vcs/jj/config/jj/config.toml index 6f5f82d..8476f5c 100644 --- a/vcs/jj/config/jj/config.toml +++ b/vcs/jj/config/jj/config.toml @@ -12,7 +12,6 @@ subprocess = true private-commits = "description(glob:'wip:*')" # refuse to push WIP commits [ui] -default-command = "log" diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"] pager = "delta" @@ -31,3 +30,6 @@ concat( diff.git(), ) ''' + +[revsets] +log = "@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()" diff --git a/vcs/jj/config/sh/alias.d/jj.sh b/vcs/jj/config/sh/alias.d/jj.sh index 4a59f92..92f3092 100644 --- a/vcs/jj/config/sh/alias.d/jj.sh +++ b/vcs/jj/config/sh/alias.d/jj.sh @@ -4,7 +4,7 @@ if ! exist jj; then return 1 fi -alias j="jj log -r '@ | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()'" +alias j="jj" if exist lazyjj; then alias lj="lazyjj" fi @@ -35,8 +35,7 @@ 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 -T builtin_log_oneline" alias jL="jj log -r 'all()'" alias jlo="jj log --summary" alias jLO="jj log --summary -r 'all()'"