GNOME Bugzilla – Bug 765021
Meld unable to diff pipe outputs (Not a regular file)
Last modified: 2016-06-13 21:54:35 UTC
Since upgrading to meld 3.15, it is no longer possible to make meld diff from a named pipe result of bash process substitution, which was very handy. In meld 3.14 it was possible to do eg: meld <(cut -d: -f 1 /etc/passwd |sort) <(cut -d : -f 1 /etc/group | sort) The bars showed the filenames like /dev/fd/63 (the program doesn't even see the command that was ran) but otherwise it worked ok. Now, it doesn't even load, with error: «There was a problem opening the file “/dev/fd/63”. Not a regular file»
This looks like behaviour that was lost with the GtkSourceView port. We currently expect everything we handle to be an actual file; just having a fd isn't enough. I think this may involve a moderate amount of work to get the Gio wrapping correct, and make sure we handle creating a GtkSourceViewLoader correctly (from a GInputStream?). However, this seems doable. I don't object to adding back support for this, since I can see that being cool, but I'm also not going to hold up the 3.16 release for it.
Is there anything requiring a rewindable fd in the diffing code? Looks like changing GtkSource.FileLoader.new() to GtkSource.FileLoader.new_from_stream() on FileDiff would do it.
That would be the core of the change, yes. I suspect it's going to be more involved than that, but I haven't spent any real time looking yet.
*** Bug 767227 has been marked as a duplicate of this bug. ***
This has been reported to Debian BTS, too: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=825979
Created attachment 329346 [details] [review] Proposed patch This is a first (and hopefully final) pass at getting this working. I'm yet to satisfy myself that this won't break anything else, but I'm feeling relatively okay about it. Since I'd like to be able to put this in the stable series, I'd really appreciate it if people could try the patch out and let me know how it goes for them. The patch is against master, but I'd expect it to apply just fine against 1.6.0; if it doesn't, let me know.
Looks OK, works fine for me with no visible regression on normal files. Thanks!
I've pushed this fix to master and the 3.16 stable branch, so it should appear in 3.16.1. Thanks for the bug reports.