git-js icon indicating copy to clipboard operation
git-js copied to clipboard

Add global / task level option for streaming stdout/stderr from child process

Open steveukx opened this issue 4 years ago • 2 comments
trafficstars

V2 allows effective streaming of the git binary's output using the setOutputHandler method, this enhancement would add a new option for streaming each task independently as an emitter.

const git = simpleGit();
const statusResult = await git.status();

// effectively the same as using setOutputHandler, receives progress from all tasks
git.on('progress', (task, stdOut, stdErr) => {});

// receives only those progress events from the status task
statusResult.on('progress', (task, stdOut, stdErr) => {});

steveukx avatar Nov 20 '20 08:11 steveukx

v3 edition Is there any way to monitor the download progress?

xiaoxian521 avatar Jan 12 '21 02:01 xiaoxian521

@steveukx Seconding @xiaoxian521's request -- it'd be great if this could be used to show progress of git clone, e.g. with a percentage. To that end, it'd also be necessary to know the total bytes expected to be downloaded. Would you consider adding such a feature? (If there isn't one already, that is :smile:)

ockham avatar Feb 12 '21 12:02 ockham