How to only allow actions from right to left (i.e. one-way merging) in Meld?

I only discovered Meld this week and it is an incredible tool - thank you for creating it!!

Is there any way of either (1) making the right side read-only, or (2) disabling comparison in both directions, only allowing right to left?

I’m using Meld to compare my current git branch (left) with another branch (right) and selectively pull in changes.

Although I only want to pull changes from right to left, it’s easy to be distracted by the left to right suggestions, and to accidentally click one of the arrows to move from left to right.

I only want to allow operations from right to left, i.e. not allow me to make changes to the right at all.

For reference, I am checking out my active branch (left) then doing git difftool against the reference branch (right) which is the one I want to be read-only in Meld:

git difftool -d referencebranch

This is my .gitconfig:

tool = meld
prompt = false
[difftool “meld”]
cmd = meld “$REMOTE” “$LOCAL” --auto-compare

Thank you so much! :grinning_face_with_smiling_eyes:

Hi. I didn’t use meld intergration with git, but have some information on the topic:

I’ve used meld integration with svn 1-2 years ago - and that integration had such feature - the svn side sets attributes of the one of the files passed to meld readonly, and meld displays a lock near that file and really forbids any modifications to it - all actions modifying that side were disabled.

So this mechanics somehow DID presenet at least in older meld+subversion integration.
And I think that protecting from misediting the wrong side it is very important feature that helps intuitiveness of comparison

Yes, this is exactly what I want!

Meld to “lock” all the files on the right so the operations can only be made to the left.

I wonder how I can get that working with git…

As a first step I suggest try to run meld directly from command line passing two files as arguments - one normal and other with readonly access rights:
meld readonly-file.txt normal-file.txt --auto-compare

If your meld version after such invokation enters the expected “single-side modification mode” - then it maybe the “job” of git-side integration to mark one of the files as readonly before passing them to meld (maybe some wrapper script).
Otherwise (no expected mode) the problem would be readonly file support in meld itself.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.