Chris R

This is such an extremely specific complaint

How I Jujutsu Bookmark Advance

jj bookmark advance is a relatively new feature1 of Jujutsu that replaced the nearly ubiquitous jj tug alias that moved bookmarks to the "tip" of their respective commit DAGs.

The way it works is by moving the matched bookmarks to the revset specified in revsets.bookmark-advance-to, which by default is @ -- ie, the current active commit.

I find that to be unhelpful because I've often got unpushable commits in my history, so mine is a bit more involved:

[revsets]
bookmark-advance-to = "closest_pushable(@)"

[revset-aliases]
'closest_pushable(to)' = 'heads(::to & mutable() & ~denylist() & ~description(exact:"") & (~empty() | merges()))'

'denylist()' = 'wip() | private()'
'wip()' = 'description(glob:"wip:*") | description(glob:"WIP:*")'
'private()' = "description(glob:'private:*')"

Collectively, this gives me a configuration where bookmarks advance to where it is "safe" to do so, rather than to the current commit. It means that jj git push doesn't try to push a commit that is otherwise denied by my push policies (because I have git.private-commits set to denylist() as well).

  1. as of version 0.39 ↩︎

Feedback

You can reply to this post via Mastodon:

Waiting to load comments

Reply to @offby1's post

With an account on the Fediverse or Mastodon, you can respond to this post. Since Mastodon is decentralized, you can use your existing account hosted by another Mastodon server or compatible platform if you don't have an account on this one.

Copy and paste this URL into the search field of your favourite Fediverse app or the web interface of your Mastodon server.