Add ons manager - development and bugs topic
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Add ons manager - git history
Hello,
currently, using the AddonManager on a workbench, the entire git history - in the .git subdirectory - is pulled from GitHub. For the Assembly4 WB for example, that means that 34Mb are pulled, of which 28Mb are in the .git directory and represent the entire past development history. While the git history is important for development contributors, it is of zero value for most users. This will, in time, with continuous development, only get worse.
Wouldn't it make sense for the AddonManager to only pull the current snapshot of the repository ? Using git archive instead of git clone probably (though I'm not a specialist)
currently, using the AddonManager on a workbench, the entire git history - in the .git subdirectory - is pulled from GitHub. For the Assembly4 WB for example, that means that 34Mb are pulled, of which 28Mb are in the .git directory and represent the entire past development history. While the git history is important for development contributors, it is of zero value for most users. This will, in time, with continuous development, only get worse.
Wouldn't it make sense for the AddonManager to only pull the current snapshot of the repository ? Using git archive instead of git clone probably (though I'm not a specialist)
- kkremitzki
- Veteran
- Posts: 2518
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Add ons manager - development and bugs topic
Could also do git clone --depth=1
Re: Add ons manager - development and bugs topic
maybe we could offer the possibility for folks to roll-back one or 2 commits if the upstream dev has introduced a fatal bug or something ?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Add ons manager - git history
This Addon Manager in my opinion requires quite a lot of work to make it more modular.
I recommend more people test this Extension Manager, a new workbench that serves as a replacement. It could eventually become the official manager.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: Add ons manager - git history
May-be, but if it's only a 1-liner to improve the current AddonManager, then we shouldn't wait for the next big thing:vocx wrote: ↑Wed Sep 16, 2020 4:04 pm I recommend more people test this Extension Manager, a new workbench
Would that still allow to detect when a workbench is outdated ? Who could do this modification ?
Re: Add ons manager - git history
Try changing line 643 of src\Mod\AddonManager\addonmanager_workers.py from:
Code: Select all
answer = repo.pull() + "\n\n" + translate("AddonsInstaller", "Workbench successfully updated. Please restart FreeCAD to apply the changes.")
Code: Select all
answer = repo.pull('--depth=1') + "\n\n" + translate("AddonsInstaller", "Workbench successfully updated. Please restart FreeCAD to apply the changes.")
Code: Select all
repo = git.Repo.clone_from(self.repos[idx][1], clonedir, branch='master')
Code: Select all
repo = git.Repo.clone_from(self.repos[idx][1], clonedir, branch='master', depth=1)
Re: Add ons manager - git history
yes, that works, nice, thank-you. But I se that the .git directory is still 5.2Mb, used by a unique file .git/objects/pack/pack-***.pack. Isn't it possible to get rid of that one also ?Syres wrote: ↑Thu Sep 17, 2020 11:25 amTry changing line 643 of src\Mod\AddonManager\addonmanager_workers.py to:
and line 663 to:Code: Select all
answer = repo.pull('--depth=1') + "\n\n" + translate("AddonsInstaller", "Workbench successfully updated. Please restart FreeCAD to apply the changes.")
I see the total size for Assembly4 being 11.2Mb using this method. You can then test the update with a minor change to your Wb on Github.Code: Select all
repo = git.Repo.clone_from(self.repos[idx][1], clonedir, branch='master', depth=1)
Re: Add ons manager - git history
I don't know, just trying to implement what @kkremitzki suggested, my git knowledge can be written on a postage stamp with a large marker pen.