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: jj edit - to go back to the previous change #5104

Closed
WaffleLapkin opened this issue Dec 16, 2024 · 1 comment
Closed

FR: jj edit - to go back to the previous change #5104

WaffleLapkin opened this issue Dec 16, 2024 · 1 comment

Comments

@WaffleLapkin
Copy link

Is your feature request related to a problem? Please describe.
I often end up needing to fixup something in an "old" commit, for which I do something like

  • jj edit old
  • do the fixup
  • jj edit newest

The last command feels somewhat inconvenient, since it requires you to remember what was the previous commit you were editing. (it can usually be easily found, but still!)

Describe the solution you'd like
I'd like for jj edit to accept - (dash) as an argument, meaning "the commit that was previously checked out". This is similar to cd - or git switch -. I'd guess the information needed is already present in the oplog.

Describe alternatives you've considered
I briefly considered having a command that would "temporary" move the current commit, allowing you to return by hitting ^C for example. This however feels very sketchy and introduces unnecessary state.

Instead of - it could also be anything else, such as a flag (--back, --prev?) or maybe some other sigil. I'd say - is preferable, given that it's what other tools tend to use (and what I tried at first myself with jj edit).

Additional context
I'm quite new to jj, so my terminology might be off 😞

@yuja
Copy link
Collaborator

yuja commented Dec 16, 2024

There are some feature requests, but not implemented yet.
#3713
#2871

(Closing as dupes)

@yuja yuja closed this as completed Dec 16, 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