-
Notifications
You must be signed in to change notification settings - Fork 319
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
jj move
from parent to child creates conflict
#3694
Comments
Also, just double checked. The same problem also applies to |
That's an internal version. Does the problem happen with a regular upstream build too? |
I think I can reproduce this. The conflict I get in the parent is:
I was wondering if this has to do with tracking missing files in conflicts (like the bug about deletion-emptyfile conflict), but I no longer think this is the case. This bug seems to happen even if you start with an empty file |
If you start with
and leave only
during the Update: I used the wrong command. If you do a squash, a very similar conflict appears. |
Correct me if I'm wrong, but it seems like there will always be a conflict when removing changes from any commit when doing a squash operation if there are hunks with more than 1 line, with at least 1 and less than all the lines in the hunk being selected. This means that there will always be a conflict when "removing" the selected lines for squashing, since the 3-way merge will result in a conflicting hunk (added hunk, a few lines selected from added hunk, empty hunk) which cannot be resolved trivially. It seems like this isn't an issue most of the time because squashing is typically done from descendant to ancestor, and the conflict will be resolved after rebasing onto the modified descendant. |
Suppose you have a commit
If we try to move the line
If we try to move the line
I think it'd be trivial to fix this by simply changing the ordering. I think we could do the following instead, which would be conflict-free (the differences are in bold):
|
I happened to notice FWIW, my two cents on this are:
I'm interested in whether my take is controversial, or whether others agree with me. |
Yeah, I was aware it went the opposite way, I was mostly just voicing my thoughts on it. Move being ambiguous is a good point though. I still maintain that squash and unsquash just adds confusion though. |
I've investigated further. Suppose we have a source commit
In reality, what we need is
It appears that unsquash solves this problem by directing you to select the contents you want to keep in the parent commit, rather than the contents you want to move. We could potentially do the same, but I don't think it'd be a great user experience, so I wouldn't recommend it. One option we could take is to add a |
Steps to Reproduce the Problem
Create an empty
jj
repo, then:Then select just the line "bar"
I came across this use case by running
jj split
, then realizing I missed putting something in the child, so I expect this to be a somewhat common use case.Expected Behavior
Neither commit should have a conflict in it
Actual Behavior
The parent commit has a conflict which is then resolved in the child
Specifications
jj google-0.17.1-jj-client_20240515_00_RC00-633966000
The text was updated successfully, but these errors were encountered: