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

Show current running commands and scripts #338

Conversation

mrexox
Copy link
Member

@mrexox mrexox commented Oct 14, 2022

Closes #336

Summary ⚡

Print the current running commands/scripts:

# lefthook.yaml
test:
  parallel: true
  commands:
    command1:
      run: sleep 1
    command2:
      run: sleep 3
    command3:
      run: sleep 4
$ lefthook run test
Lefthook v1.1.2
RUNNING HOOK: test
  EXECUTE > command1

⠧ waiting: command3, command2

@mrexox mrexox marked this pull request as ready for review October 14, 2022 11:38
@mrexox mrexox added this to the 1.2.0 milestone Oct 14, 2022
@mrexox mrexox merged commit 38930d6 into evilmartians:master Oct 14, 2022
@abitrolly
Copy link

Nice. If the command runs more than 5 minutes, it may worth to add running time.

I don't know if it is possible to measure bottlenecks for child processes, but if all commands are competing for disk I/O or memory, because they are being run in parallel, it may be worth to warn about that too, to optimize the times needed to run these hooks in future.

@mrexox
Copy link
Member Author

mrexox commented Oct 14, 2022

Good suggestion. Although it requires some statistics gathering, because we need to understand what is too much time/memory and what is not.

Also limiting the concurrency is a thing to consider. I am welcome for new suggestions, please, come and create some issue :)

Or you can start a discussion instead: https://github.com/evilmartians/lefthook/discussions, and we can continue it there. This is a good point for a discussion, especially for such a big projects like GitLab.

@abitrolly
Copy link

Thanks. Not this week, but next time I run into this, sure, I'll make a thread.

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.

None yet

2 participants