-
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
conflicts: materialize simplified conflicts for each file #3719
Conversation
b642d0a
to
4756533
Compare
4756533
to
58951f2
Compare
58951f2
to
d66c17b
Compare
Could you also add some tests making sure that a simplified conflict can be edited? I haven't checked carefully, so I'm sorry if there already are tests for that. |
8d7d42d
to
bb1bd58
Compare
Updated. While modifying some changes in this PR, I was able to use the built version to run |
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 for working on this!
This PR doesn't do quite what I thought it would; I was thinking of a much more limited simplification, possibly without needing any sort of deduplicate
. I wonder whether I missed something important or whether this should be simplified to do less.
7b975fd
to
4496a58
Compare
3f0e03f
to
4b59505
Compare
Actually, does anybody have an example of a set of tree merges which creates a conflict which can be further simplified on the file level? I'm not sure if I'm doing something wrong but I can't seem to figure out a good example. |
Does "conflict simplified on the file level" include all aspects: contents, name, existence, executable bit? Or is this just about contents? |
Here's the example I had: If it doesn't work for you as is, look for one of the parent commits (currently ilyagr@2a3abbe and its parent, named " Make tree-level-conflicts the default in tests" and "make new trees the default in tests The examples you already have might also start working with those commits. |
Thanks @ilyagr for the pointer, I didn't realize the code in the tests were using the legacy |
This PR will only simplify the contents of conflicted files, which have the same path. (This includes deletions.) |
A more concrete example that would work for integration tests and be more or less representative of the most important case: have a merge of two commits that both modify |
Using this branch, I've noticed that in a merge commit, some changes from parent commits disappeared entirely. Perhaps this is the issue @ilyagr is seeing? The commit is available at https://github.com/kadena-io/chainweb-node/tree/push-lzwyzupppxrz. |
How about a set of jj commands which cause this to happen directly to commits instead of the internal |
If I understand correctly what you're asking for, this should work:
You should now have a 3-sided conflict file2 and in the root tree. Because we don't do per-file simplification yet, the conflict in file1 would also be 3-sided, but it could be simplified to a 2-sided conflict. Is that what you were looking for? |
Martin's suggestion should work fine. My suggestion from #3719 (comment) is a lot more verbose, but I find it in some ways easier to reason about: jj new -m 'base'
echo base > fileA
echo base > fileB
jj new; jj branch create A1
echo X > fileA
jj new @-; jj branch create A2
echo Y > fileA
jj new @-; jj branch create B1
echo Z > fileB
jj new @-; jj branch create B2
echo W > fileB
# jj new A1 A2 B1 B2 would work at this point already,
# but I find the following easier to think about:
jj new A1 A2; jj branch create conflictA
jj new B1 B2; jj branch create conflictB
# conflictA has a conflict in fileA, no change to fileB
# conflictB has a conflict in fileB, no change to fileA
jj new conflictA conflictB
# The conflicts in fileA and fileB should have 2 sides
# each, but currently will have more sides.
cat fileA
cat fileB |
cf10d28
to
90988bb
Compare
7c24c82
to
22a7683
Compare
22a7683
to
1f5daa3
Compare
1f5daa3
to
be2ac1f
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.
Thank you very much! The new update_from_simplified
worked out very nicely.
I had a few last comments for tests, all minor. Please also wait for Martin to approve.
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 again for this! Looking forward to this getting released.
…ified/deduplicated
95e810e
to
b8c8500
Compare
…ized simplified conflict
b8c8500
to
0eb1efb
Compare
Closes #2795.
Checklist
If applicable:
CHANGELOG.md