GNOME Bugzilla – Bug 329903
Terminal-based actions for files
Last modified: 2012-08-14 22:09:00 UTC
Patch files are recognized by nautilus, but the only action available is to open with the text editor. It would be useful to have an item in the Open with... submenu that applies the patch.
Thanks for your bug report! Your proposal looks like an ideal candidate for a Nautilus extension. In theory, it sounds nice, but I doubt that in practice many patches apply cleanly, at least to my experience. Those which apply cleanly are often incorporated by distros. Maybe you could elaborate a bit on how exactly it should work and what the use-case it?
My current use case is working on gnome documentation. I want to review a patch (bug 324966 by the way). I currently have to: 1. save the patch file to the right folder 2. switch terminal to that folder (OK, I have the "terminal here" script installed so that's not so bad) 3. remember the command to apply a patch, which involves trawling through several pages on live.gnome.org It would be nice if steps 2 & 3 could automated: right-click on the patch file, "Open with... -> Apply patch". Perhaps a second command could be provided to reverse apply a bad patch.
If you really want to "blindly" apply patches without saving them to disk and reviewing them, I recommend you to open a terminal and write a script doing gnomevfs-cat http://bugzilla-attachment-uri | patch -p0 - In contrast, a Nautilus extension wouldn't save you step 1., so I really doubt this is useful to many people.
Sorry, I think I haven't made myself clear, perhaps because I may have misused the terminology. I didn't mean to automate step 1, just 2 & 3. All I am seeking to do is to issue the "patch -p0 < file.patch" command from Nautilus rather than from terminal. Of course the user can examine the patch file after step 1. (I thought "reviewing" a patch meant "apply it to my local copy of the file and then look at that file to see what it does". I'm not l33t enough to read a .patch file directly and for XML docs it doesn't really make much sense anyway.)
Sorry, I'm a bit of a newbie to applying other people's patches. I just got one that gave lots of FAILED messages and I see what you mean about patches now. An Open With command that launches Gnome Terminal and issues the patch command is the sort of thing I had in mind.
I'm thinking that this should actually be more generalized. Working on docs, I have to issue the command: xmllint --xinclude --noout --postvalid user-guide.xml No way I can remember that, and even if I create an alias, dragging a file to Terminal is tedious. This could happen instead: * assign that command to XML files * right-click on file, choose "Verify with xmllint" * window opens to display terminal output * done :) So what I think this needs is: * some sort of GUI wrapper for terminal output * a means to add commands to the Open With menu that allows a custom description
Created attachment 61114 [details] script to validate Joachim: here's a script that does this for you. You need zenity.
oh, and put it in ~/.gnome2/nautilus-scripts/ and then right click on the file you want to validate, select Scripts, and click validate.sh
I think what I meant with this bug has been expressed on a recent blog post (sorry, can't find it, was on Planet Gnome one or two days ago but I don't see how to go further back on that page). It said basically that the one-on-one mapping of mimetype to application was limiting. With an MP3, you might want to: listen, add to playlist, add to queue, etc. This is the same sort of thing I meant for patch files, and also for things like DocBook files, where I want to: view, edit, validate.
Sorry for bugspam, but got the post: http://joeshaw.org/2007/01/14/452
Seems like a job for nautilus scripts.