On Tue, Apr 27, 2010 at 10:30 PM, Anthony Lieuallen <[email protected]> wrote:

> Now, if you install a user script, Greasemonkey treats it as correct and
> authoritative -- including the metadata, including the @includes and
> @excludes.  It may very well be true that version N @included a particular
> URL, but the site changed and version N+1 specifically does _not_ @include
> that same URL.
>
> When you install version N+1 (note the OP said "update a script") then your
> @includes and @excludes are those listed in the file.  Period.
>
> It may also be that the user removed, added, etc. any of the @include and
> @exclude rules.  There's no knoweldge now of what's a "script" URL and
> what's a "user" URL, though in theory we could record that when you edit it.
>  Proposed changes for 1092 would actually make this significantly less
> possible.

So basically there is no automatic way to know during an 'update'
(=new install) whether the @*cludes in the new version of the script,
or those in the installed version are those the user wants to keep.

One approach to this problem would be to show a diff (new version
against installed version) to the user. S/he could then choose what to
keep from the author's version and what to keep from the own edited
headers.  The diff functionality doesn't have to be built into
Greasemonkey, it could be delegated to a configurable external editor
with this capability. This is handy because decent editors already
have means to handle diffs and to accept/reject changes on a one by
one basis.

Incidentally, the idea of a diff would apply to the whole script as
well, as a means to make apparent what changed.  If config.xml is
finally deprecated in favour of the scripts contents as the
authoritative source for metadata, a 'diff' button available during
installation would cover the requirement automatically.

And thinking about diff during installation, if I'd go one step
forward in my fantasy, maybe it would be great to keep the currently
installed version as back up, and to enable the user to 'revert to
previous version' after having either examined the new code or tested
it a little.

I suggest the following:
1) Script code as the authoritative source of metadata - no config.xml
2) Keep last installed version as back up to enable both diff and
reverting to old version
3) Possibility to configure a diff command, for example to launch an
editor with both scripts in diff mode.

And as nice-to-have:
4) UI for configuring editor (for both edit and diff)

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en.

Reply via email to