meld: Make one part read only

1k Views Asked by At

Up to now I used emacs ediff mode for merging. I tried meld, but could not find a way to make one buffer/file read only. I never merge in two directions, that's way I make one part read only before merging.

2

There are 2 best solutions below

0
On

This article can help you I believe. It says

[merge]
tool = mymeld
[mergetool "mymeld"]
cmd = meld --diff $BASE $LOCAL --diff $BASE $REMOTE --diff $LOCAL $MERGED $REMOTE

This is what I call traditional two-way merge with tabs. Now, since I already noted Meld supports three-way merging, there is another option. When “diff3” git conflict style is set, Meld prints “(??)” on the line showing the content from BASE. In this mode, LOCAL and REMOTE files are read-only which is also handy.

0
On

The "Merge mode (in development)" section on the meld features page calls this Lock down and that kind of functionality doesn't seem to be released yet, beside it not being clear if this can be used outside of merge mode. ( status 2020-08 )

WHat you can do is make the file you don't want to change (temporarily) read-only. That will give you a lock-icon and a grey-ed out "Save file in this pane" icon next to your filename, and you cannot edit the file in that pane.