Clone each repository once when it ships several addons (closes #52) - #53
Merged
Conversation
A repository providing several addons was cloned and reinstalled once per addon, and the progress counter grew quadratically with the size of each repository group. - get_addon_states: request remote state once per distinct (url, branch) instead of once per addon, so the counter runs 1/N..N/N - cmd_update: group selected addons by (url, branch) and clone each repository once - mygit.fetch_states: keep per-remote branches in an ordered set so the module itself guarantees one RemoteState per (url, branch) - cmd_update: collapse identical per-repository errors into one line - toc.find_addons: name an addon after its folder rather than the .toc stem, falling back to the stem when the folder ships no matching base .toc; multi-TOC addons no longer install under a suffixed folder name that breaks dependency resolution - install_addon: drop config entries whose addon disappeared from the repository, deleting the folder only when its checksum still validates Measured on the repositories from the issue (34 addons across 6 repositories): 6 clones instead of 34, 34 installs instead of 648. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #53 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 551 583 +32
Branches 88 97 +9
=========================================
+ Hits 551 583 +32 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #52.
A repository providing several addons was cloned and reinstalled once per addon, and the progress counter grew quadratically with the size of each repository group.
Changes
get_addon_states— request remote state once per distinct(url, branch)instead of once per addon.fetch_statesused to yield oneRemoteStateper duplicate request, and each of those was fanned out across every addon of the repository, givingΣ group_size²progress increments. The counter now runs1/N..N/N.cmd_update— group the selected addons by(url, branch)and callinstall_addononce per repository.install_addonhas always been repository-level: it clones once and installs every addon it finds.mygit.fetch_states— keep per-remote branches in an ordered set, so the module itself guarantees oneRemoteStateper(url, branch)regardless of how the caller builds the request list. Onelist_heads()call per distinct URL, as before.cmd_update— collapse identical per-repository errors into one line, so a broken repository with five addons no longer prints five identical messages.toc.find_addons— name an addon after its folder rather than the.tocstem. With the standard multi-TOC layout (DBM-Core.toc+DBM-Core-WOTLKC.toc) the suffixed file used to win purely becauserglobsorts-before., so the addon was installed intoAddOns/DBM-Core-WOTLKC/, breaking## Dependencies: DBM-Coreresolution (WoW resolves dependencies by folder name) and orphaning SavedVariables. The folder name now wins whenever the folder actually ships a matching base.toc; otherwise the stem is kept so the installed folder always contains a loadable<Folder>.toc.install_addon— drop config entries whose addon has disappeared from the repository. Such entries can never advance their stored commit, so they stayoutdatedforever and pull a clone on every run. Detection scans the clone without the expansion filter, so an addon that merely does not match the current game version is never mistaken for a stale one. The folder is deleted only when its checksum still validates; a hand-edited folder is left in place with a warning and shows up asuntracked.Verification
Measured with the repositories from the issue —
ElvUI-WotLK/ElvUI(2 addons),ElvUI_AddOnSkins,ElvUI_Enhanced,Bunny67/WeakAuras-WotLK(4 addons),Ascension-Addons/DeadlyBossMods(25 addons),Zendevve/OmniInv-WoW— 34 addons across 6 repositories:update648/3434/34The installed tree was checked afterwards: all 34 folders contain the
<Folder>.tocthe 3.3.5 client loads, no required dependency is unresolved,WeakAuras/Libs/**stays nested instead of being split into separate addons, and the installed files match the source repositories exactly.209 tests pass (including the integration suite) with 100% line and branch coverage.
🤖 Generated with Claude Code