Skip to content
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

clone-repo: Display clone repo progress #139

Merged
merged 2 commits into from
Dec 8, 2024

Conversation

junglerobba
Copy link
Contributor

Closes #137

No idea if my calculation of the download rate is even slightly correct tbh, but it seems about right for the speeds that I usually get.
Didn't feel like including another crate just for one progress bar, so this is just a slightly scuffed one using block characters

I've noticed the need for the new config option because I've repeatedly cloned a very large repo while developing this, and sometimes switched to another session and then it would finish cloning in the background and rip me out of what I was currently doing somewhere else.

Configures whether to automatically switch to the new session after the
`clone-repo` command finishes
`Always` will always switch tmux to the new session
`Never` will always create the new session in the background
When set to `Foreground`, the new session will only be opened in the
background if the active tmux session has changed since starting the
clone process (for long clone processes on larger repos)
@jrmoulton
Copy link
Owner

I think there is an easier way to do this

https://docs.rs/git2/latest/git2/struct.RemoteCallbacks.html#method.transfer_progress

@junglerobba
Copy link
Contributor Author

I think that is what I am using, but I wanted to show an approximation of the current download speed, and I don’t think that is included there

@jrmoulton
Copy link
Owner

Oh whoops. Sorry I missed that.

@jrmoulton jrmoulton merged commit 643a30b into jrmoulton:main Dec 8, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clone-repo command should show clone progress
2 participants