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: Add an option "jj rebase --skip_empty" or similar #2588

Closed
matts1 opened this issue Nov 17, 2023 · 5 comments
Closed

FR: Add an option "jj rebase --skip_empty" or similar #2588

matts1 opened this issue Nov 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@matts1
Copy link
Collaborator

matts1 commented Nov 17, 2023

Is your feature request related to a problem? Please describe.
When you rebase commits that have been squashed, you end up with empty commits.
I always have to follow up "jj rebase -s 'all:(children(IMMUTABLE) & ~IMMUTABLE)' -d main@origin" with jj abandon 'empty() & ~IMMUTABLE & ~merges().

Describe the solution you'd like
Git rebase has "--empty=drop|keep|ask". I imagine a similar solution would work just fine for jj

Describe alternatives you've considered
I currently run jj abandon 'EMPTY after rebasing every time

Additional context
Add any other context or screenshots about the feature request here.

@matts1
Copy link
Collaborator Author

matts1 commented Nov 17, 2023

Happy to assign this to myself, looking at the code it doesn't look too hard

@martinvonz
Copy link
Member

Sounds like a duplicate of #229?

@matts1
Copy link
Collaborator Author

matts1 commented Nov 17, 2023

API clarification: Should I make it --empty=drop or --skip-empty?

--empty=drop would allow us to later do --empty=ask, which I have mixed feelings about. Rebases should always succeed in JJ, so I'm tempted to go with --skip-empty, but I saw a FR for jj rebase --interactive, where it might make sense to actually ask.

@martinvonz
Copy link
Member

I agree that we should not make it interactive. What's the FR for jj rebase --interactive? #1531? Even if we have an initial interactive phase in that command where you reorder commits etc., I think the rest of it should just execute the request plan non-interactively.

Regarding the exact name, do you think we should even call it --skip-emptied instead of --skip-empty to clarify that already empty commits will not be skipped? Or should we drop already empty commits too (maybe we should continue on #229)? Also, should it be "skip" or "abandon"?

@PhilipMetzger PhilipMetzger added the enhancement New feature or request label Nov 17, 2023
@matts1
Copy link
Collaborator Author

matts1 commented Nov 20, 2023

As you said, dup of #229, we can continue discussions there

@matts1 matts1 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 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

3 participants