Thread Tools Display Modes
05/26/17, 12:02 AM   #1
iwontsay
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 27
AddOn patches as patches?

I'm pretty sure this is the right place to post my suggestion, even if the title may suggest otherwise, since my idea would concern the site infrastructure much more than AddOns themselves.

In short, in my humble opinion it would be great to submit patches and plug-ins to AddOns as patch files, generated by tools like "diff -u" or "git diff".

Why, you may ask?

Currently patches are either complete packages themselves or completely replace affected files in the AddOn they work upon. While it works for simple hotfixes which are superseded when the author of the original AddOn incorporates a (cleaner) fix, other patches are to include additional functionality the author of the original AddOn doesn't include into his works for some reason.

Said patches - or plugins - would remain 'valid' even for subsequent versions of the original AddOn, but since in their current implementation they replace the files, updates would be difficult and the patch is bound to break the AddOn in later versions.

For non-coders, "diff -u" files just record changes done to the original files, not the whole contents. Even if the original files change - because they have been updated, for example - if the affected sections stay the same, the patch could readily be applied again but would fail if the affected code sections differ from the version this patch was originally created from.

This greatly reduces storage needs and makes it MUCH easier for the original author of the AddOn to see what changes had been done in order to fix a bug.

For the site it would need:
  • On creating the patch, one has to state which AddOn it is patching against
  • Either the patch is to be submitted as a diff file, or, if it is submitted as a whole archive, the diff is generated on site
  • On downloading from the site, one may choose to download the raw diff to apply to the AddOn oneself, or the site generates a patched package based on the original one and the patch applied to it.
  • As a bonus, the site may offer a list of patches when viewing the original AddOn, and on checking the wanted patches, the site would generate a patched package.

Minion would need to be adapted as well:
  • Downloading a patch would require the original AddOn to be downloaded in any case, then the patch applied to it.
  • When the possibility of several patches on a single AddOn is to be taken into account, Minion would have to create a dependency graph to determine the order of the updates being performed.

Yes, I'm aware that this would require a boatload of work, though it could be a great addition?
  Reply With Quote
05/31/17, 12:24 PM   #2
Dolby
Every day I'm shuffling
 
Dolby's Avatar
Premium Member
WoWInterface Admin
Join Date: Feb 2004
Posts: 1,276
You have an interesting suggestion. I'm just not sure who would want to download the diff?

I could see this working as allowing other authors to submit a diff patch to the original AddOn in our database and if its accepted the original AddOn is patched with that diff and the zip & version is updated instead of offering an optional download. This of course would have to be enabled by the original author or team member as I'm sure some authors would not want to allow this on their AddOns. It would almost be like submitting a PR on github, but it would be with a diff patch.
  Reply With Quote
05/31/17, 03:47 PM   #3
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2016
Posts: 408
I think a difference file could potentially be useful even for normal addons. If someone customizes an addon for themself, then when the addon is updated those changes are overwritten. Maybe there could be an optional checkbox to simply overwrite the previous files, or just change the differences.
  Reply With Quote
06/03/17, 03:52 AM   #4
iwontsay
AddOn Author - Click to view addons
Join Date: Apr 2016
Posts: 27
Originally Posted by Dolgubon View Post
I think a difference file could potentially be useful even for normal addons. If someone customizes an addon for themself, then when the addon is updated those changes are overwritten. Maybe there could be an optional checkbox to simply overwrite the previous files, or just change the differences.
This. I think the comparison with git pull requests may have some merit and could give grounds to work on. But I think it would be too much workload if the git management of this site should allow for forking of existing repositories.... Since it would only benefit those addons and authors already hosting their addons as git repositories.

But in essence, storing the patches to existing addons (like "No, Thank You! - Morrowind" in relation to "No, Thank You!") as diffs would very much benefit the portability of patches to future versions, especially if it contains things like additional languages or features the original author doesn't want to implement, but may very much be sought after.

On downloading, one could choose to download the diff file itself for various reasons - either to easily review the changes done to the addon or to manually apply the patch -, or have the server apply the patch to the waiting download to have the patched addon in the archive. If the patch fails for some reason, there's definitely need to download the patch and review it.

In addition, the command "patch" recognizes if the changes to apply have already been done to the original file (or files). For example, when the author decided to incorporate the patch into his own addon, with or without even more unrelated changes. In that case, the patch itself has become obsolete and would only be of interest for historical reasons.
  Reply With Quote

ESOUI » Site Forums » Site help, bugs, suggestions/questions » AddOn patches as patches?

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off