logoalt Hacker News

y1n0today at 12:57 AM2 repliesview on HN

I make a commit and the branch doesn't follow it. Bookmark, whatever. That is never a behavior I would want. What purpose does it serve?


Replies

stousettoday at 3:27 AM

Of all the things I was imagining it might be, this was down at the bottom.

Personally I’m a huge fan of this approach. If you aren’t, it’s literally just a one-liner (that is trivially made into an alias) to advance a branch name to the most recent revision. And now there’s a feature to do auto-advancing if you want it.

Why is it this way? Because jj is designed around revisions being constantly mutated.

In git, when I make a commit, I am typically signaling that that a chunk of work is complete. Not always, but usually. In most jj workflows, revisions are mutated constantly during development. A revision being made on the tip of a branch is rarely a signal that that unit of work is finished. It’s even incredibly common to have multiple revisions in a row that are works in progress. Hell, the article we’re all commenting on discusses just such a workflow. If I make five revisions on top of some branch, there is no reason to assume that any of them are ready to be shared, much less all of them.

Because of that difference, it makes sense to have an explicit act to move a branch name forward.

paradox460today at 1:35 AM

They added auto advance bookmarks a while ago. You configure which revset bookmarks you want to advance or not, and then it just keeps them at the "head" of a branch

show 1 reply