mirror of
https://github.com/initialcommit-com/git-sim.git
synced 2026-04-26 19:15:51 +03:00
[PR #77] [MERGED] Increase performance of typer autocompletion by breaking out subcommand functions into their own module #86
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/git-sim#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/initialcommit-com/git-sim/pull/77
Author: @MathiasSven
Created: 3/24/2023
Status: ✅ Merged
Merged: 3/25/2023
Merged by: @initialcommit-io
Base:
dev← Head:main📝 Commits (2)
2cbb1caSeparate commands from manim modulescb4eec8delay importing git package📊 Changes
22 files changed (+393 additions, -364 deletions)
View changed files
📝
git_sim/__main__.py(+24 -41)📝
git_sim/add.py(+0 -13)📝
git_sim/branch.py(+0 -12)📝
git_sim/checkout.py(+6 -19)📝
git_sim/cherrypick.py(+0 -18)📝
git_sim/clone.py(+9 -18)➕
git_sim/commands.py(+315 -0)📝
git_sim/commit.py(+0 -19)➕
git_sim/enums.py(+14 -0)📝
git_sim/fetch.py(+1 -15)📝
git_sim/log.py(+0 -18)📝
git_sim/merge.py(+0 -17)📝
git_sim/pull.py(+6 -18)📝
git_sim/push.py(+10 -19)📝
git_sim/rebase.py(+0 -12)📝
git_sim/reset.py(+1 -36)📝
git_sim/restore.py(+0 -13)📝
git_sim/revert.py(+0 -13)📝
git_sim/stash.py(+1 -23)📝
git_sim/status.py(+0 -9)...and 2 more files
📄 Description
Fixes #76
The main problem seemed to be loading
manim. By separating the commands from the modules wheremanimneeds to be loaded, it is possible to delay loading it until a command is actually executed, since the auto-completion only relied on those command functions being registered bytyper.While the auto-completion is still a bit slow, it is a significant improvement (3x), and as a bonus because
manimisn't loaded theManim Community v0.16.0.post0log doesn't clutter the output ofgit-sim --show-completion SHELL.Previous:
https://user-images.githubusercontent.com/24759037/227437226-8cc733ff-6c98-423c-ba9b-7d49e3074011.mp4
With PR:
https://user-images.githubusercontent.com/24759037/227437053-cd4edcb7-62cb-4fcd-980a-30a6b129dc50.mp4
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.