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 329903 - Terminal-based actions for files
Terminal-based actions for files
Status: RESOLVED WONTFIX
Product: nautilus
Classification: Core
Component: general
2.12.x
Other All
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-02-04 16:38 UTC by Joachim Noreiko
Modified: 2012-08-14 22:09 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
script to validate (329 bytes, text/plain)
2006-03-12 02:07 UTC, Brent Smith (smitten)
Details

Description Joachim Noreiko 2006-02-04 16:38:16 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.
Comment 1 Christian Neumair 2006-02-04 17:49:12 UTC
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?
Comment 2 Joachim Noreiko 2006-02-04 18:00:23 UTC
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.
Comment 3 Christian Neumair 2006-02-04 19:08:12 UTC
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.
Comment 4 Joachim Noreiko 2006-02-04 19:24:14 UTC
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.)
Comment 5 Joachim Noreiko 2006-02-11 11:24:11 UTC
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.
Comment 6 Joachim Noreiko 2006-03-11 08:51:20 UTC
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
Comment 7 Brent Smith (smitten) 2006-03-12 02:07:36 UTC
Created attachment 61114 [details]
script to validate

Joachim: here's a script that does this for you.  You need zenity.
Comment 8 Brent Smith (smitten) 2006-03-12 02:08:15 UTC
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
Comment 9 Joachim Noreiko 2007-01-19 09:38:30 UTC
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.
Comment 10 Joachim Noreiko 2007-01-19 09:42:07 UTC
Sorry for bugspam, but got the post:

http://joeshaw.org/2007/01/14/452
Comment 11 William Jon McCann 2012-08-14 22:09:00 UTC
Seems like a job for nautilus scripts.