-
Notifications
You must be signed in to change notification settings - Fork 433
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
FR: Improve conflict resolving for binary files #3540
Comments
Have you tried |
I think a better way to do this currently is Although yeah it's if you know which version you want to keep, doesn't give you a way to compare and choose |
Thank you both for the fast response! @martinvonz I can try that out. I just had the "meld" tool at hand, but it seems, it can only handle text files. (I'm a Windows user, by the way. 😉) To be honest: It's not so, that I have often to deal with binary files within Version Control Systems. (Up to 99%, I have to work with plain source code and text files within Version Control Systems. 😅) @necauqua Thank you for this hint! That is really the better workaround for that issue. I will remember that. |
One tool that worked pretty well for me was any IntelliJ IDE (e.g. PyCharm Community Edition). IntelliJ has plugins to compare images in the diff, possibly other types of files. There is also https://www.scootersoftware.com/beta. They have a generous free trial, and image support, but it's a bit hit or miss (the image comparison was very slow for me and for other types of files). |
@ilyagr Thank you also very much for that recommendations! (Well, in the open source space, there are really not that many good diff/merge tools, which can simply handle all kind of files.) I tried it with WinMerge and it worked as expected. Here is the configuration for the jj config.toml file: [merge-tools]
winmerge.program = "winmergeu"
winmerge.edit-args = ["/e", "/s", "/u", "$left", "$right"]
winmerge.merge-args = ["/e", "/s", "/u", "$left", "$base", "$right", "/o", "$output"] Of course, the directory of Just as a side note or recommendation for other WinMerge Users: |
Technically, the community editions of IntelliJ tools are open source. I'm not sure how easy they are to use if you get them from the GitHub repo, though. |
Another side of this is that we currently treat binary files as text and insert conflict markers in them. That's not useful, wastes time (can be significant for very large files), and produces unnecessarily large files. The latter is something we ran into at Google because we refuse to save files larger than N bytes, but even if you have inputs smaller than N bytes, you can end up with a conflicted file of size almost 3N bytes (or more for higher-arity conflicts). |
Is your feature request related to a problem? Please describe.
The problem is related to that Issue #2757.
For example:
You have a project with images (
*.jpg
,*.png
, etc.) or other native file formats, which are generated by your tool of choice. (*.blend
project files from Blender, any Office documents, etc.)Currently, when you have to resolve a conflict of such binary file, it's impossible to do it right now, because the conflicted binary files getting merged together into one "blob" of unusable data.
Describe the solution you'd like
The solution to that problem would be quite simple. (At least from the usability point of view. Maybe not on the implementation side to be honest. 😉)
When the user wants to resolve a given conflict with a binary file, jj could put both files side by side into the current workspace folder.
For example:
You have a file
flower.jpg
.Then you have two different changesets:
aaaa
andbbbb
. (These are the random identifiers, which jj generates on everyjj new
.)In both changesets,
flower.jpg
changed, of course.Then, if you want to merge these changesets (or rebase one onto the other), jj could simply place both files side by side with filenames like
flower.aaaa.jpg
andflower.bbbb.jpg
.This would make the conflict resolving process for binary files really easy for the user.
Describe alternatives you've considered
The current work around for that problem is this (to stay on my example above):
I do a
jj new aaaa
and rename the fileflower.jpg
toflower.aaaa.jpg
. (That new changeset based onaaaa
may be namedcccc
for that example.)Then I switch to the other changeset
bbbb
withjj new bbbb
and do ajj squash --from cccc
.Then, I have the two files in one place side by side:
flower.jpg
andflower.aaaa.jpg
. Then I can simply decide, which file to keep. In that example, I would deleteflower.jpg
and renameflower.aaaa.jpg
toflower.jpg
.Additional context
There is no additional context.
The text was updated successfully, but these errors were encountered: