Repository: jj-vcs/jj

Issue #5667: FR: Streamined Git Push/Pull Workflow
Created: 2025-02-12T15:02:09Z
Is your feature request related to a problem? Please describe.
A pain point for me using jj is the extra typing involved to do the equivalent of "git push" and "git pull". Namely, the manual moving around of bookmarks when pushing and pulling is both error prone and tedious for me, especially when doing it frequently (which I often do). I'm the kind of guy that likes to push every few minutes to the remote repository.
Describe the solution you'd like
My dream solution is to be able to run jj git push without having to first run jj bookmark move. I'd also like to be able to run jj git pull (a command that does not exist at the time of writing) instead of jj git fetch followed by manually creating a merge commit.
Describe alternatives you've considered
Maybe there is a fancy way to write a revset to do this?
Additional context
Nothing.

Duplicate issue #5927: FR: Consider `jj bookmark fastforward` or similar
Created: 2025-03-08T00:58:49Z
Is your feature request related to a problem? Please describe.
It might be nice for users to have a convenient way to move the "current branch" bookmark up (for workflows that are closer to git-like), rather than needing to manually specify the bookmark and the position to move to.
Describe the solution you'd like
jj bookmark fastforward (name/options/... could easily be bikeshed, I am more so talking about the semantics) would take the one "obvious" bookmark, and move it to the one "obvious" revision. If there isn't an obvious one for either, then it should not do anything, and instead request the user to use jj bookmark move.
Regarding "obvious":

one way to define an "obvious" bookmark is to be the nearest bookmark in the ancestors of @; possibly more restricted is to ensure it satisfies push-bookmark-prefix. I'm not sure how restricted we'd like this (possibly configurable by options)?
for an "obvious" target to move to: @ is pretty obvious, but we also probably don't want to use @ if it is an entirely empty commmit, in which case we probably want to use @-
the intention with "fast forward" naming is to have similar semantics to not allowing backwards moves

Describe alternatives you've considered
I am currently using this alias:
# Fast forward my latest bookmark on the current branch to the latest non-empty
# (or merge) commit.
ff = [
  "bookmark", "move",
  "--from", "latest(bookmarks(jayb) & ancestors(@))",
  "--to", "latest(ancestors(@) & (merges() | ~empty()))"
]
which works fine for my use case, but obviously it only works for people who share my name 🙃  It is possible I am not even using the ideal/fastest/optimal/... revsets here, but at least all the time that I've used it so far, it has not failed me (although I haven't used it particularly long).  However, I suspect that this particular operation is common enough that it might be something to consider being a jj bookmark ... built-in command.
Additional context
Since there is a straightforward-enough workaround by adding an alias, I don't know how crucial adding such a feature is. It is possible this might just be an alias (with necessary updates to above example alias to make it more general/friendly) added to the docs, possibly here: https://jj-vcs.github.io/jj/latest/bookmarks/#ease-of-use

Closing comment (2025-03-08T23:07:22Z): This is similar to #5667 and thus also relates to #3402, for now the alias is the best thing we can offer.