squash -i squashes things I didn't expect #4722
-
I'm currently trying out jj and am pretty impressed so far. I managed to create a scenario in which I don't understand why Here's my log:
Here's the relevant snippet of my code:
I add "(no wait this sucks)" to line 2 and want to squash it into
Now I run So far, so good, this is what I expected, since this is the only change that I made on
And the code now looks like this:
There are two things I don't understand about this:
Looking forward to your input! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
It's not clear to me what's going on. Perhaps you meant to squash from You could use It's also possible that you're seeing a bug having to do with the built-in diff editor or If you .tar.gz the entire repo, we might be able to help looking at the operation log (though I can't promise to do it immediately). |
Beta Was this translation helpful? Give feedback.
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:
Then,
jj restore --from Y --to B
would setfile
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 becauseY
is an "empty commit"; its diff relative to its parent is empty.jj squash
…