After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 321637 - Read-only file handling
Read-only file handling
Status: RESOLVED FIXED
Product: meld
Classification: Other
Component: filediff
1.1.x
Other Linux
: Normal enhancement
: ---
Assigned To: Stephen Kennedy
Stephen Kennedy
: 689790 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-11-16 18:26 UTC by John Sullivan
Modified: 2012-12-24 00:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description John Sullivan 2005-11-16 18:26:50 UTC
Meld allows hunks to be transferred from writable files into read-only files,
then complains when you try to exit. It would be nice to have the option to
disallow editing on such files. This could be as a preference for all r/o files
and/or a commandline to mark a particular file as non-editable regardless of
file permissions.
Comment 1 Stephen Kennedy 2005-11-20 12:00:30 UTC
What use case do you have to mark an editable file as non-editable?
Comment 2 John Sullivan 2005-12-07 03:16:46 UTC
Sorry about the delay replying.

Actually, just noticing that some of the files/directories don't have write
permission would probably be enough.

In my particular case, I'm trying to interface with Perforce. There are two
options here: either invoke meld (actually a shell script around meld) as
perforce's external merge tool. In this case P4 provides four files: a common
ancestor, the clashing version, your version, and the output file (initially
equal to your version) which will be accepted. The first three it makes
read-only. Obviously the wrapper script can only pass two of the others to meld
to provide a 3-way diff. And P4 repeats this process for each individual file in
a checkin.

The other case I have is my own script which attempts to do something similar on
the entire current working directory by extracting info from the repo and making
/tmp copies of everything it needs. I can make the various versions read-only if
necessary, but in fact there is an additional feature which I believe is already
reported as a separate bug which is the ability to label arguments.

Ideally I'd like to be able to explicitly mark on the command line: This
file/dir (and all the files in it) is to be labelled "Original", and is
read-only; This file/dir is to be labelled "Final" and is writeable; This
file/dir is to be labelled "Theirs" and is read-only. That gives the most
flexibility.

(I'm quite fascist about SCM interfacing: I really don't like doing anything
unless I know *exactly* what is going to result, which means being able to tell
each component in the chain at least once what I expect it to be doing. Safety
first or there's no point in using one.)

But just noticing read-only files and forbidding edits would be cool.
Comment 3 Stephen Kennedy 2006-07-04 22:23:41 UTC
You can now specify labels on the command line.
Meld also shows a different icon for nonwritable files.
There is still no logic to prevent changes to the buffer though.
Comment 4 Paul Smith 2009-08-07 21:30:26 UTC
I'd really like this as well.  When scm merge utilities invoke 3-way merges, they always have two of the files as temporary files (the "basis" version and the "other" version) which were grabbed from the SCM tool simply to allow the merge tool to have the right file contents to work on.  Those are temporary files and editing them is useless, even if they are writable.

It would be really, really nice, and alleviate much confusion, if meld could have some files marked as non-modifiable, so that changes could only be made to the modifiable files.
Comment 5 Kai Willadsen 2012-12-06 20:39:54 UTC
*** Bug 689790 has been marked as a duplicate of this bug. ***
Comment 6 Kai Willadsen 2012-12-06 20:45:18 UTC
Just some quick further notes on this. Merge mode already works this way. If one of the files is set to be non-editable, merging into that file is disabled, and other actions are adapted accordingly.

As it stands, having a read-only file does *not* set a file to be non-editable; merge mode does this manually. The reason for this is that some people find it useful to be able to edit individual files to better understand a merge. One option would be to provide a UI toggle for whether a given pane is editable or not. This should be very easy --- almost trivial --- to code, but UI-wise we don't have anywhere sensible to put it, and it's going to look bad.
Comment 7 Yuri 2012-12-06 21:18:27 UTC
If this is personal taste dependent, you can make it an option and have it both ways. It is very confusing when meld offers to edit file in the repository. By default it should reflect what the situation is, explicitly read-only, and as an option it can be made like today.

In fact, file selection box over the versioned file currently displays something like this:
/tmp/tmpVCOwzb-meld/my-file.tcl

It should say:
subversion rev.NNNNN (/tmp/tmpVCOwzb-meld/my-file.tcl)
Should be explicitly clear. And don't allow user to change this choice like you allow today. It is always possible to make combobox uneditable when particular choice is made.

Also, this bug is up from 2005. I think it is a good policy when bug becomes the highest priority after certain time. Say, critical release blocker after 3 years. Otherwise, how many years can such bug drag on?
Comment 8 Kai Willadsen 2012-12-06 21:45:57 UTC
I'd appreciate it if you could adjust your tone. Please consider that as the maintainer, *I know all this already*.

Your suggestion would give us about 50 release blocking bugs, several of which require significant rewrites of various modules. As such, I can't imagine there would ever *be* another release.

There is currently exactly one person (me) working on Meld's code base on a semi-regular basis, and a couple of additional people making very much appreciated, but still occasional, commits. This bug will 'drag on' until someone gets time to work on it. Feel free to be that someone.

(Apologies to other people being bugzilla-CCed.)
Comment 9 Yuri 2012-12-06 22:44:03 UTC
Sorry for this, there is no way I could know how many people are on the meld project. Bugzilla doesn't have such field yet ;-)

BTW, in general bug response time has no relation to how many resources are allocated on the project. Example is Apple llvm project having all manpower in the world and still some patches (ready to apply patches !) aren't applied for months and months. And they go stale and require additional work after a while.
Comment 10 Kai Willadsen 2012-12-24 00:30:52 UTC
Read-only files are now not editable by default; there is a toggle to enable editing of read-only files. Changes are in HEAD.