(Somewhat related to #20 but more specific for one use case.)
For the workflow:
git commit (without -m)
- pre-commit hook
- edit long commit message
It is a bit awkward to look at a black screen while waiting to edit the commit message, especially if the hook takes a minute to run.
Some progress output while the hook executes would be nice to have.
Example idea with step 2 command 3 still in progress:
Step 1: checks
├─ Command 1 .......................... [Ok] 500ms
╰─ Cmd 2 .............................. [Ok] 8s90ms
Step 2: unit tests
├─ Command 1 .......................... [Ok] 1s345ms
├─ A Very Long Command 2 .............. [Ok] 1m7s
╰─ Command 3 ..........................
With this format you could simply progressively print the output, without having to delete/update already printed output.
You could just print "├─ {command_name} ......" without a newline, where the dots represent the in progress state.
(calling io::stdout().flush() afterwards, print! & println are usually line buffered.)
Once the command is done you can print the success/failure and timings followed by the newline.
The dots would be used for alignment with command names of different length.
The -v flag could control whether to print only one line per step or one per command, but that would be just another optional a nice to have.
(If the steps/commands are executed in parallel, there would be need for some type of synchronisation. For example via sync::Barrier, thread::JoinHandle, sync::mpsc, or sync::Condvar)
(Somewhat related to #20 but more specific for one use case.)
For the workflow:
git commit(without -m)It is a bit awkward to look at a black screen while waiting to edit the commit message, especially if the hook takes a minute to run.
Some progress output while the hook executes would be nice to have.
Example idea with step 2 command 3 still in progress:
With this format you could simply progressively print the output, without having to delete/update already printed output.
You could just print "├─ {command_name} ......" without a newline, where the dots represent the in progress state.
(calling
io::stdout().flush()afterwards, print! & println are usually line buffered.)Once the command is done you can print the success/failure and timings followed by the newline.
The dots would be used for alignment with command names of different length.
The -v flag could control whether to print only one line per step or one per command, but that would be just another optional a nice to have.
(If the steps/commands are executed in parallel, there would be need for some type of synchronisation. For example via sync::Barrier, thread::JoinHandle, sync::mpsc, or sync::Condvar)