diff --git a/jj/config.toml b/jj/config.toml index 477eb9b..9582a26 100644 --- a/jj/config.toml +++ b/jj/config.toml @@ -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).