Skip to content

Conversation

@obayemi
Copy link

@obayemi obayemi commented Oct 2, 2025

The only thing I don't particularly like about jj is how I need to remember my branches names and type them (at least partially with completion) when I'm putting several changes on a branch (like during a review)

This PR adds a jj bookmark bump (or jj b b) that takes the latest bookmark in the changes tree and bumps it to the latest non-empty commit, removing IMO some of the pain of working with branches on environments where rewriting history is frowned upon by:

  • removing the need to re-specify the branch name everytime you need to bump to commit
  • having to think about if it is a simple jj b s <bookmark> or a jj b s <bookmark> -r @- if it was commited before instead of only updating the description

While staying a conscious effort

I was building this as a standalone script, but decided to integrate it directly to jj instead.

I'm probably going to use and maybe maintain this fork myself, please tell me if it is a feature you might consider integrating into upstream jj, and if so, what I could do to improve the code quality and integration with the rest of the codebase

Thanks in advance :)

DISCLAIMER: I'm not very familiar with jj's codebase and relied heavily on claude code to build this feature

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes

@obayemi obayemi requested a review from a team as a code owner October 2, 2025 16:14
@obayemi obayemi changed the title feat(bookmark): add bump command to advance bookmarks to latest descndants feat(bookmark): add bump command to advance bookmarks to latest descandants Oct 2, 2025
@obayemi obayemi force-pushed the feat/jj-bump-version-management branch from 1f52eca to 6287424 Compare October 2, 2025 16:44
@martinvonz
Copy link
Member

See https://jj-vcs.github.io/jj/latest/contributing/ (things I've noticed after a quick look: squash the commits, update the commit description's subject line, move much of the PR description into the commit description)

@martinvonz
Copy link
Member

And thanks for the PR, btw! I didn't mean to sound ungrateful.

@obayemi
Copy link
Author

obayemi commented Oct 3, 2025

you're completely right sorry, I meant to keep the PR for myself while adding finishing touches and squash before opening it on the upstream repo but didn't check the target branch, I'll squash right away

@obayemi obayemi force-pushed the feat/jj-bump-version-management branch from 6287424 to eadd6aa Compare October 3, 2025 12:29
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following commits do not follow our format for subject lines:

  • 1e66b45: Merge branch 'jj-vcs:main' into feat/jj-bump-version-management

Commits should have a subject line following the format <topic>: <description>. Please review the commit guidelines for more information.

@obayemi obayemi force-pushed the feat/jj-bump-version-management branch from 1e66b45 to c24afca Compare October 3, 2025 12:38
@github-actions github-actions bot dismissed their stale review October 3, 2025 12:38

All commits are now correctly formatted. Thank you for your contribution!

@zx8
Copy link

zx8 commented Oct 4, 2025

FWIW from poking around the issue tracker, I think the generally accepted term for this is "tug" rather than "bump"? Longer term jj enthusiasts are welcome to jump in and correct me though!

@PhilipMetzger
Copy link
Contributor

please drop the conventional commit message prefix and replace it with cli bookmark: or just bookmark: <your-title> since conventional commits explicitly are mentioned in the contributing message guidelines.

@glehmann
Copy link
Contributor

glehmann commented Oct 4, 2025

This is a feature that could be useful as a plain command, but IMO it should reproduce the behavior described in #5568 (reply in thread)

@obayemi obayemi force-pushed the feat/jj-bump-version-management branch from c24afca to 187ac88 Compare October 6, 2025 14:30
@obayemi
Copy link
Author

obayemi commented Oct 6, 2025

This is a feature that could be useful as a plain command, but IMO it should reproduce the behavior described in #5568 (reply in thread)

Thx, I didn't see this discussion.

I'm not really convinced about the specificities of the behaviour in the discussion though
I think It might be depending on preferences and workflow, but In my opinion, limiting the tug to changes both with description and non empty is needlessly limiting

I should probably talk about it in the discussion though.

Enables automatic bookmark advancement without manual targeting, streamlining branch workflow with multiple branch
@obayemi obayemi force-pushed the feat/jj-bump-version-management branch from 187ac88 to 4f6e660 Compare October 6, 2025 15:11
@obayemi obayemi changed the title feat(bookmark): add bump command to advance bookmarks to latest descandants draft: add bump command to advance bookmarks to latest descandants Oct 6, 2025
@glehmann
Copy link
Contributor

glehmann commented Oct 7, 2025

limiting the tug to changes both with description and non empty is needlessly limiting

Maybe we missed something. Could you share a use case where you would want to push an empty commit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants