Skip to content

Conversation

glehmann
Copy link
Contributor

@glehmann glehmann commented Oct 9, 2025

fix: #3665
based on #7690

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

@glehmann glehmann requested a review from a team as a code owner October 9, 2025 21:16
@glehmann glehmann marked this pull request as draft October 9, 2025 21:16
@glehmann glehmann force-pushed the gln/prev-next-keep-option-ymzm branch 4 times, most recently from 1eec0ac to ea04ae3 Compare October 12, 2025 20:48
@glehmann glehmann marked this pull request as ready for review October 12, 2025 20:48
Comment on lines 74 to 76
/// Keep the changes when moving to the next revision
#[arg(long, short, conflicts_with = "edit")]
keep: bool,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe better to say that the working-copy changes are rebased? "keep" can also mean the opposite thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried to avoid --rebase, because the short option, -r, would look too much like -r for --revision(s) in the other command for my taste. --rebase is a better name though.
Maybe -R for the short option? Or do I worry for nothing for -r?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PhilipMetzger do you have an opinion on what would be the best option name? --keep? --rebase? Something else?

Copy link
Contributor

Choose a reason for hiding this comment

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

I called it keep because Martin called it like that.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not attached to --keep if we have a better name. I like --rebase better but I agree that -r is not ideal. Maybe we don't need a short form, at least to start with? Maybe it's not so bad with --r<TAB>.

Copy link
Contributor

Choose a reason for hiding this comment

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

Something like --carry/bring/drag?

They're just synonyms for --keep which was the initially proposed name. So I agree that they don't make more sense than --rebase though.

Even if we go with --keep, I think the help text should mention that the working-copy revision is rebased, not kept in the original position.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've been thinking a bit about that, and I don't think --revision would make sense for these commands, and -r here is a flag—we don't pass a value—so there is much less chance to get confused.

I think I would go with --rebase/-r and see how users react to that.
Maybe mark the flag as experimental so we can rename it easily in case of negative feedback?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we try that without the short -r flag? It's unlikely we'll add -r/--revision to these commands, but the existence of -r can provide false impression that next/prev would bring you to the nearest revision within the range, e.g. jj prev -rmutable().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think a short option is quite valuable here, but if we can't find anything better, sure, we can do that

Copy link
Contributor

Choose a reason for hiding this comment

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

My vote is to keep the short option just -k so we don't spread more confusion, if you want it so much.

@glehmann glehmann force-pushed the gln/prev-next-keep-option-ymzm branch 5 times, most recently from 54acbd8 to 119681e Compare October 15, 2025 21:13
@glehmann glehmann changed the title prev/next: add --keep option prev/next: add --rebase option Oct 15, 2025
…s children

We shouldn't be in that case, and it can lead to confusing situations with next
completely switching branch.

fix: jj-vcs#7046
This allows to rebase unfinished working copies when moving through history.

fix: jj-vcs#3665
@glehmann glehmann force-pushed the gln/prev-next-keep-option-ymzm branch from 119681e to c2ad24a Compare October 17, 2025 11:51
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.

FR: prev/next --rebase/--keep to carry along your current changes when moving

4 participants