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: swap command (was known as "better tools for reordering commits part 1") #1530

Closed
ilyagr opened this issue Apr 17, 2023 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@ilyagr
Copy link
Collaborator

ilyagr commented Apr 17, 2023

A swap command could have the obvious UI: jj swap rev1 rev2. I'm not sure if we can do better than:

  • Both revsets have to resolve to single revisions
  • The parents of rev1 will be whatever the parents of rev2 were. This behavior would be a bit confusing for empty merge commits (which are common), so I'd disallow merge commits by default and have an option to enable it.

In terms of implementation, this is related to #1188.

This is a baby version of #1531.

@ilyagr ilyagr added the enhancement New feature or request label Apr 17, 2023
@ilyagr ilyagr changed the title FR: swap command, better tools for reordering commits part 1 FR: swap command (better tools for reordering commits part 1) Apr 17, 2023
@dbarnett
Copy link
Collaborator

Instead of creating two different command names, could one command do both if you support a non-interactive variant of reorder under the same command name? Initially you could support whatever special case operations are easiest and reject attempts to do anything else.

Personally if I had a full reorder command I'd just forget swap every existed and consider it clutter.

@ilyagr
Copy link
Collaborator Author

ilyagr commented Apr 18, 2023

Yes, the more I think of it the less attractive it becomes. What you really want, usually, is to move a commit to before/after another commit. Martin pointed that out in #1188 (comment).

@ilyagr ilyagr closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2023
@ilyagr ilyagr changed the title FR: swap command (better tools for reordering commits part 1) FR: swap command (was known as "better tools for reordering commits part 1") Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants