Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: repetition counts for + and - #4055

Closed
Zoybean opened this issue Jul 9, 2024 · 2 comments
Closed

FR: repetition counts for + and - #4055

Zoybean opened this issue Jul 9, 2024 · 2 comments

Comments

@Zoybean
Copy link

Zoybean commented Jul 9, 2024

Is your feature request related to a problem? Please describe.
Most often when I'm undoing something, I'll look at the op log and then figure out the number of operations I want to undo, then count that many -'s, e.g.: jj op restore @---.
I rarely have a use for more than 2 + or -, outside of jj op restore.

Describe the solution you'd like
I'd like to be able to say jj op restore @-3.
Naturally, this feature would allow both + and - operations to accept a nonnegative integer count, on arbitrary revsets.
Unfortunately, if these are handled as postfix operators, I figure this would imply that things like @-3+2 and pathological combinations like @--3+2++0-+ would be valid syntax, which I think are not desirable, but may be necessary in order for the feature to work.

Describe alternatives you've considered
I could just copy the hash of the state I want to revert to, or continue to count repetitions of + and -. This avoids over-complicating the syntax for such a small gain.

@yuja
Copy link
Contributor

yuja commented Jul 9, 2024

Related: #3337

For op restore specifically, some interactive UI to pick from the last ~10 operations might be useful. Maybe that can also be achieved by using fzf. https://github.com/martinvonz/jj/wiki/fzf

@Zoybean
Copy link
Author

Zoybean commented Jul 9, 2024

Closing in favour of related issues

@Zoybean Zoybean closed this as completed Jul 9, 2024
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

No branches or pull requests

2 participants