-
Notifications
You must be signed in to change notification settings - Fork 345
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
Make jj squash --from
accept multiple commits
#3276
Conversation
6f51621
to
3160cb2
Compare
I'm going to teach the function to support combining more than two descriptions.
29f8620
to
fa5eaa0
Compare
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.
lgtm, thanks.
… sources I plan to teach `jj squash --from` to accept a revset as input.
Now you can do e.g. `jj squash --from 'foo+::' --into foo` to squash a whole series into one commit. It doesn't need to be linear; you can squash a bunch of siblings into another siblings, for example.
fa5eaa0
to
adb5a9c
Compare
@@ -105,8 +105,7 @@ aborted. | |||
// case). | |||
if new_parent_tree_id == parent_base_tree.id() { | |||
tx.mut_repo().record_abandoned_commit(parent.id().clone()); | |||
let description = | |||
combine_messages(tx.base_repo(), parent, &commit, command.settings(), true)?; | |||
let description = combine_messages(tx.base_repo(), &[parent], &commit, command.settings())?; |
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.
Is unsquash
simply split
?
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.
No, jj squash -r X
moves from X into its parent (by default), while jj unsquash -r X
moves from the parent into X.
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.
How does that relate to split
?
Or are you saying the squash action is on the graph and not the content?
(It's really difficult to determine what affects just the graph and what affects the content.)
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.
split
takes a single commit and splits it in two, while squash
and unsquash
move changes between existing commits (and it removes commits that became empty).
Did you consider using Perhaps we could also improve the |
Related to @emesterhazy's comment, I did not find it immediately obvious that
Maybe describing this as |
|
They mean something different for |
I agree about this.
I'm not too worried about this point, maybe because "squash" implies the destination is mutated. |
Hmm, I didn't think of that. Personally I think the semantics for If we keep the current names I think we should clarify the description of |
I forgot to say that |
FWIW GitHub diff uses: GitLab diff uses: It may be worth considering the terms these and other forges (perhaps even non git ones) use for this. I am particularly fond of the GitLab terms here. |
I think part of my opposition to But for I would propose the following:
I think this will be more logically consistent and ergonomic since we'll have short flags |
We have had similar discussions before. I'm not sure what to search for to find those discussions, unfortunately. Btw, another example is that |
Oh, I also meant to say that I don't feel very strongly either way, so don't think that I'm ignoring you because I disagree; I'm just hoping that others will share their thoughts if they feel strongly. |
Yeah, this is just a proposal and not urgent. There are a few people subscribed to comments on this PR, but if nobody chimes in I can open a PR with these changes to collect comments. I think that in my opinion |
I think To me, both |
Closes #2678
Checklist
If applicable:
CHANGELOG.md