Show git clone progress bar and percentage complete#71341
Show git clone progress bar and percentage complete#71341joaomoreno merged 1 commit intomicrosoft:masterfrom
Conversation
4e4ceea to
fb0feb1
Compare
| disposables.push(toDisposable(() => ee.removeListener(name, fn))); | ||
| }; | ||
|
|
||
| const cloneProgressOutput = ['Receiving objects', 'Resolving deltas']; |
There was a problem hiding this comment.
This clone-specific work should not be done in the generic exec method. Clone should just switch to using stream instead.
There was a problem hiding this comment.
Also, two more "events" are missing: Counting objects and Compressing objects.
|
|
||
| if (progress) { | ||
| progress.report({ | ||
| message: localize(cloneOutput.toLowerCase(), cloneOutput) + ': ' + inc + '%', |
There was a problem hiding this comment.
Localize can only be used with literal strings, there's no way this would ever work.
| if (progress) { | ||
| progress.report({ | ||
| message: localize(cloneOutput.toLowerCase(), cloneOutput) + ': ' + inc + '%', | ||
| increment: inc - prevInc |
There was a problem hiding this comment.
This progress is incorrect. It goes twice from 0 to 100, which causes the progress bar to reset halfway. Since we know there are two phases, we should just divide everything by 2.
|
|
||
| // Check for git clone progress reporting | ||
| cloneProgressOutput.forEach(cloneOutput => { | ||
| if (s.startsWith(cloneOutput)) { |
There was a problem hiding this comment.
It is not guaranteed that output comes line by line. So you should use something like byline to get lines.
|
Despite all the comments, I didn't want to ask for changes and then come back and context switch once again... so I just fixed the PR and addressed the comments. Thanks, good job! 🍻 |
Adds functionality to show a progress bar and completion percentage during the git clone command. Closes #70467.
The notification shows a progress bar for both "Receiving objects" and "Resolving deltas" progress outputs, along with a percentage complete.