-
Notifications
You must be signed in to change notification settings - Fork 2
Add a parallel implementation #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
const STYLE_LOAD: &str = "{prefix:>40!.blue} {msg} {wide_bar} {percent:>3}% {eta}"; | ||
const STYLE_DONE: &str = "{prefix:>40!.blue} {wide_msg} {elapsed_precise}"; | ||
const STYLE_ERROR: &str = "{prefix:>40!.blue} {wide_msg:.red}"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the alignment either completely left aligned or justified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left align : (use ^ for centering)
const STYLE_LOAD: &str = "{prefix:<40!.blue} {msg} {wide_bar} {percent:>3}% {eta}"; | |
const STYLE_DONE: &str = "{prefix:<40!.blue} {wide_msg} {elapsed_precise}"; | |
const STYLE_ERROR: &str = "{prefix:<40!.blue} {wide_msg:.red}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const STYLE_PRELOAD: &str = "{prefix:.blue} {spinner} {wide_msg:.cyan}"; | |
const STYLE_LOAD: &str = "{prefix:.blue} {msg} {wide_bar} {percent:>3}% {eta}"; | |
const STYLE_DONE: &str = "{prefix:.blue} {wide_msg} {elapsed_precise}"; | |
const STYLE_ERROR: &str = "{prefix:.blue} {wide_msg:.red}"; |
I would suggest not giving a size to the prefix. The paths can be of any length and will be truncated if it doesnt fit right now. Let it always print the entire path and then the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this change as part of ur fork as well since you will still be working on it? Or should I make the change once I merge?
Thanks for the contribution. This is really useful. I have added some comments for some minor changes. Do let me know your thoughts. |
Tagging @dineshba |
@tinou98 there seems to be another issue with the clone command. Previously if we try to clone the same repo to the same local path, it would fail saying the path already exists which is expected. Now it just stalls. Can you check what is happening?
(error is not currently handled properly. But it should still fail) On your fork it doesnt fail. It just gets stuck. I also tried it for a repo that does not exist. It stalls. |
Also I think parallelism should be an option. If enabled use based on number of CPU's or user input count. If disabled fall back to single threaded execution. I worry that some systems might hang if all CPU's are used for gg. |
Fixed blocked issue, added control over the number of thread, setting to 1 go back to the monothreaded way. There is still an issue in monothreaded mode ( |
It's Good. You can continue to work on it. Ill merge these now. |
Added a parallel implementation so everything is faster. It's based on rayon, so it will default to the same number of parallel task as your number of CPU.
I also added a progress bar for clone and fetch