Skip to content

squash -i squashes things I didn't expect #4722

Answered by ilyagr
mr-flannery asked this question in Q&A
Discussion options

You must be logged in to vote

I didn't follow all you wrote here (yet, sorry about that), but I'm wondering if the problem is that the squash command doesn't do quite what you think it does. In particular, I'm responding (perhaps too quickly) to your statement that "So I'd expect it to work the same from both changes", which is wrong (in general, at least).

Let's say we have this tree:

X     file = 3
| Y   file = 2
|/
A     file = 2
B     file = 1

Then, jj restore --from Y --to B would set file to 2 in B, as one would probably expect.

However, jj squash --from Y --to B is quite different. In this case, it would not do anything. This is because Y is an "empty commit"; its diff relative to its parent is empty. jj squash

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mr-flannery
Comment options

@ilyagr
Comment options

ilyagr Oct 29, 2024
Collaborator

Answer selected by mr-flannery
@mr-flannery
Comment options

@arxanas
Comment options

arxanas Oct 29, 2024
Collaborator

@yuja
Comment options

yuja Oct 30, 2024
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants