dotfiles/vcs/jj/config/jj/config.toml
Marty Oehme a000a58a23
jj: Adopt new default revset aliases
This commit changes the way I display my jj logs a little. We
distinguish between 3 styles now

- the 'stack()': short and to the point, only ancestor commits from the
  last non-mutable one onwards
- the 'recent()': the previously default view over ancestor commits or
  any other head nodes (i.e. any branches) that are from me,
  with a few commits leading up to them visible.
- the 'all()': the traditional 'show everything' summation for finding
  very specific commits or getting a macro-scale overview of the history

Basically, only the 'stack()' view was added - but it is now the new
default for the default command and the previous 'default' has been
renamed to 'recent()'.

This is mirrored in the shell aliases: all the `jl`, `jlo`, `jloo`
aliases use the 'recents()' view. The capital versions (`JL` and the
like) are not affected as as they keep showing the 'all()' view.
Importantly, the `j` base command uses the 'stack()' view, however.

Lastly, we extract the aliases to find `WIP:` commits and `PRIVATE:`
commits into actual jj revset aliases and call them from our shell
aliases. The functionality does not change, though we now have an
additional alias for finding specifically the latter commits with `jlfp`
('jj log find private').
2025-06-22 09:53:17 +02:00

89 lines
2.7 KiB
TOML

[user]
email = "contact@martyoeh.me"
name = "Marty Oehme"
[signing]
backend = "gpg"
key = "73BA40D5AFAF49C9"
[git]
sign-on-push = true
private-commits = "description(glob-i:'WIP:*') | description(glob-i:'PRIVATE:*')" # refuse to push WIP commits
[ui]
default-command = ["log", "-T", "builtin_log_oneline", "-r", "stack()"]
diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
# use delta as formatter but _only_ for diff and show
# see: https://github.com/jj-vcs/jj/discussions/4690#discussioncomment-12388965
[[--scope]]
--when.commands = ["diff", "show"]
[--scope.ui]
pager = "delta"
diff-formatter = ":git"
[aliases]
# see: https://shaddy.dev/notes/jj-tug/, update most recent bookmark
tug = ["bookmark", "move", "--from", "heads(::@- & bookmarks())", "--to", "@-"]
[templates]
# Add git diffs to commit drafts
draft_commit_description = '''
concat(
description,
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat(72)),
),
"\nJJ: ignore-rest\n",
diff.git(),
)
'''
[template-aliases]
# Changed order of normal oneliner around:
# keep revID, but then first thing bookmarks/tags/head and descriptions
# only afterwards show email, timesatmp, commitID since I am less interested
builtin_log_oneline = '''
if(root,
format_root_commit(self),
label(if(current_working_copy, "working_copy"),
concat(
separate(" ",
format_short_change_id_with_hidden_and_divergent_info(self),
if(conflict, label("conflict", "conflict")),
bookmarks,
tags,
if(description,
description.first_line(),
label(if(empty, "empty"), description_placeholder),
),
if(author.email(), author.email().local(), email_placeholder),
format_timestamp(commit_timestamp(self)),
working_copies,
format_short_commit_id(commit_id),
if(config("ui.show-cryptographic-signatures").as_boolean(),
format_short_cryptographic_signature(signature)),
if(empty, label("empty", "(empty)")),
if(git_head, label("git_head", "git_head()")),
) ++ "\n",
),
)
)
'''
[revsets]
log = "recent()"
[revset-aliases]
"bases" = "dev"
"downstream(x,y)" = "(x::y) & y"
"branches" = "downstream(trunk(), bookmarks()) & mine()"
"curbranch" = "latest(branches::@- & branches)"
"githead" = "::git_head()"
"wip()" = "description(regex:\"^WIP:\")"
"private()" = "description(regex:\"^PRIVATE:\")"
"blacklist()" = "wip() | private()"
"recent()" = "ancestors(@, 5) | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"
"recent(x)" = "ancestors(x, 5) | ancestors(trunk()..(visible_heads() & mine()), 2) | trunk()"
"stack()" = "ancestors(reachable(@, mutable()), 2)"