-
Notifications
You must be signed in to change notification settings - Fork 392
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
Add --insert-after
and --insert-before
to jj new
#1172
Conversation
57ab5c5
to
e595bc8
Compare
|
e595bc8
to
7108cd8
Compare
82b3c85
to
b0c365e
Compare
@samueltardieu: This PR and PR #1167 are still in draft state, as you probably know. Does that mean that you're still working on both or are they ready for review? If they are, which one would you prefer to keep? I think I like this one better. I'm not sure I've gotten a good sense of what others prefer. |
I've used this a bit, and it works well (though i haven't tried it with multiple revision arguments). However, I'm starting to lean towards having a new
One issue here is that it's less clear whether |
b0c365e
to
dcd901d
Compare
I'm still working on this one to deal with edge cases, mostly to avoid loops. When this is done I'll mark it as ready so that I can get a review, and moreover we can decide whether if this stays in |
633f0e2
to
8404437
Compare
--rebase-children
and --insert
to jj new
(with commit rebasing)--insert-after
and --insert-before
to jj new
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Samuel! I have a few minor and one case where I think this will do the wrong thing (see below).
I'm also wondering whether we should refactor the rebase_descendants
function so that it's usable here and the code is more modular. That's certainly not a blocker for discussing this PR.
a440c50
to
b9899d7
Compare
67050a0
to
9c28d6d
Compare
For the record - and I think I said this somewhere else already - being able to insert new commits before multiple other commits seems very powerful, but I'm still not sure how useful it is :) I'm also still unsure if the user will typically want to edit the newly created commit. I don't mind getting this merged despite those concerns. We can just move it later. I don't know at what point we need to start worrying more about not making breaking changes in the CLI... |
9c28d6d
to
8d39439
Compare
At least This is why I would rather keep this in Since it is possible to make command aliases, one can alias |
Agreed. It may not be very useful (or maybe it is?), but it's consistent, and the single-parent case behaves as one would expect and is useful. To me, the decision between |
cc719a1
to
56e8709
Compare
56e8709
to
54af335
Compare
20a9007
to
b2ec8af
Compare
(pushed again to get a new Windows runner – the build was still ongoing after 2 hours, and not close to the end) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Let's try it out :)
I feel like we should try to refactor and make rebase and this code use the same helper functions, but this can be done later, and now we'll have nice tests to guide us.
b2ec8af
to
11e4a8a
Compare
11e4a8a
to
c5ebb3f
Compare
I probably missed helper functions that would have made the code prettier. The discussion is in #1155.
Checklist
If applicable:
CHANGELOG.md