config/jj/config.toml

54 lines
2.5 KiB
TOML

#:schema https://docs.jj-vcs.dev/latest/config-schema.json
# Symlinked to ~/.config/jj/config.toml by init.sh. To override anything on a
# specific machine/account, drop any *.toml into ~/.config/jj/conf.d/ — jj loads
# that directory and it wins over this file.
[user]
name = "Sami Samhuri"
email = "sami@samhuri.net"
[git]
push = "github"
fetch = "github"
[revsets]
# Where `jj b advance` (aka `jj b a`) lands the closest bookmark: @ normally, but
# @- when @ is an empty change, so a fresh scratchpad doesn't drag the bookmark
# off the work. The set of bookmarks to advance comes from the built-in
# `revsets.bookmark-advance-from` default, heads(::to & bookmarks()).
bookmark-advance-to = "(@ ~ empty()) | (@ & empty())-"
[revset-aliases]
# Prefer the github remote, and treat a `dev` integration branch as trunk when
# it exists (hobby repos where dev is worked on and merged to main to release).
# latest() picks the most recently-committed of whichever are present.
"trunk()" = "latest(present(dev@github) | present(dev@origin) | present(main@github) | present(master@github) | present(main@origin) | present(master@origin) | root())"
# Tip changes (heads) you own that carry no bookmark and aren't in trunk.
"unbookmarked()" = "(visible_heads() & mine()) ~ bookmarks() ~ ::trunk()"
# Your mutable work-in-progress: everything you own that isn't in trunk yet.
"open()" = "mine() & ~::trunk()"
# Local bookmarks that have drifted off trunk and likely need rebasing: not yet
# merged into trunk (~::trunk()) and not already sitting on top of it
# (~trunk()::). The longer one has been off trunk, the more likely it conflicts.
"behind_trunk()" = "bookmarks() ~ ::trunk() ~ trunk()::"
[aliases]
# Compact log of your open work.
wip = ["log", "-r", "open()"]
# Your unbookmarked tip changes.
tips = ["log", "-r", "unbookmarked() & mutable() ~ empty()"]
# Your bookmarks (local + remote) with date + name.
bks = ["log", "--no-graph", "-r", "(bookmarks() | remote_bookmarks()) & mine()",
"-T", "separate(\" \", committer.timestamp().local().format(\"%Y-%m-%d %H:%M\"), separate(\" \", bookmarks, remote_bookmarks)) ++ \"\\n\""]
# Your bookmarks that have drifted off trunk, date + name. The quick "which of
# my branches are stale?" view. For "will they conflict when rebased?", run the
# `jj-rebase-check` script (it actually tests each merge against trunk).
stale = ["log", "--no-graph", "-r", "behind_trunk() & mine()",
"-T", "separate(\" \", committer.timestamp().local().format(\"%Y-%m-%d %H:%M\"), bookmarks) ++ \"\\n\""]