Use jj b advance instead of a tug alias

Drop the tug alias plus its closest_bookmark and tug_target revsets in favour
of the built-in jj b advance. The bookmark-advance-from default already matches
the old closest_bookmark, and setting revsets.bookmark-advance-to keeps the
empty-scratchpad behaviour (land on @, or @- when @ is empty).
This commit is contained in:
Sami Samhuri 2026-06-18 07:59:39 -07:00
parent c9698b86b3
commit a41717ab98

View file

@ -12,6 +12,13 @@ email = "sami@samhuri.net"
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).
@ -24,13 +31,6 @@ fetch = "github"
# Your mutable work-in-progress: everything you own that isn't in trunk yet.
"open()" = "mine() & ~::trunk()"
# The bookmark nearest below a given rev — powers `tug`.
"closest_bookmark(to)" = "heads(::to & bookmarks())"
# Where `tug` should land the bookmark: @ normally, but @- when @ is an
# empty change (so a fresh scratchpad doesn't drag the bookmark off the work).
"tug_target()" = "(@ ~ empty()) | (@ & empty())-"
# 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.
@ -47,9 +47,6 @@ tips = ["log", "-r", "unbookmarked()"]
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\""]
# Drag the closest bookmark up to @ (or @- when @ is an empty change).
tug = ["bookmark", "move", "--from", "closest_bookmark(tug_target())", "--to", "tug_target()"]
# 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).